On Mon, 02 Aug 2010, Nicholas Clark wrote: > What I can't work out is whether there is any shortcut way in ANSI C to find > out whether a value is -0, distinct from 0, short of *printf(). In ASNI C99 you can use copysign(), but that is not required in C89. It has been an IEEE 754 recommended function, so it is present in many older libraries. The only other way I can think of is computing 1/x and checking if you get -Inf or Inf, but that may be a costly operation, given that it will throw a floating point exception. Cheers, -JanThread Previous | Thread Next