KJ> Does Visual C++ have a similar function? If so, in what header
file
KJ> is it located and what is the name of the function? If not, would
omeone
KJ> please show me a function to determine the sign of a number which would
KJ> return 1 if positive, 0 if zero, and -1 if negative...?
The first bit of a number signifies the sign of a number
so
char c = (some number);
negative = (c & 0x80);
zero = (c & (-1));
positive = !negative;
1000 0000 is 0x80
-1 = all ones 1111 1111
--- GEcho 1.00
---------------
* Origin: Digital OnLine Magazine! - (409)838-8237 (1:3811/350)
|