Path: utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!bu-cs!lll-winken!uwm.edu!zaphod.mps.ohio-state.edu!mips!ardent!mac From: mac@rhea.ardent.com (Mike McNamara) Newsgroups: gnu.gcc Subject: Re: IEEE FLP question: Use of NAN and Inf Message-ID: Date: 20 Dec 89 23:09:12 GMT References: <6788@tank.uchicago.edu> <258EB169.7950@paris.ics.uci.edu> Sender: news@ardent.UUCP Reply-To: mac@ardent.com (Michael McNamara) Organization: Ardent Computer Corporation, Sunnyvale, CA Lines: 34 In-reply-to: rfg@ics.uci.edu's message of 19 Dec 89 22:08:41 GMT rfg> In article <258EB169.7950@paris.ics.uci.edurfg> rfg@ics.uci.edu (Ron Guilmette) writes: rfg> rfg> In article <6788@tank.uchicago.edurfg> phd_ivo@gsbacd.uchicago.edu writes: phd_ivo> phd_ivo> Moreover, can someone please tell me how to define phd_ivo> the IEEE double's of +Inf, -Inf, and NaN, so that phd_ivo> I can assign and test for them? rfg> rfg> That's a damn good question, and one for which I would like an answer rfg> as well. rfg> rfg> The basic problem appears to be that there is no such thing as a rfg> "bitwise-verbatim" conversion in C (or in GCC). Thus, you cannot rfg> take an arbitrary bit pattern and do anything like the following: rfg> rfg> float f = (float) 0x80000000; rfg> rfg> without getting the (unwanted) effect of int =rfg> float conversion. rfg> Try float f; *(int*)&f = 0x80000000; this works on every c compiler I'm aware of. rfg> // rfg -mac -- Michael McNamara (St)ardent, Inc. mac@ardent.com