Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site alice.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!alice!ark From: ark@alice.UucP (Andrew Koenig) Newsgroups: net.lang.c Subject: Re: How to test for +/- INFINITY, etc. in C with IEEE Message-ID: <4695@alice.UUCP> Date: Thu, 12-Dec-85 11:32:21 EST Article-I.D.: alice.4695 Posted: Thu Dec 12 11:32:21 1985 Date-Received: Fri, 13-Dec-85 08:45:29 EST References: <993@turtlevax.UUCP> Organization: Bell Labs, Murray Hill Lines: 17 > The C compiler should assume that only decimal constants need be > converted from integer to floating point. > Octal and hexadecimal constants are used to represent bit patterns, not > numbers. There is no reason that the compiler should assume that a > particular bit pattern represents an integer rather than a > floating-point number or something even more exotic. Every constant is an expression. Every expression has a type. The meaning of an operator depends only on the type of the expressions that are its operand and on which operator it is. If you need to get at the bits in a float, do something like this: union {float f; long l;} bits; bits.f = ....; if ((bits.l & 0x7f800000) == 0x7f800000) ...