Groovy hepcat Kurt J. Tischer jived with All on 08 Jul 97 01:06:00!
Signs of numbers's a cool scene. Dig it!
KJT> functions uses a function internal to VB called Sgn, which returns an
KJT> integer (1, 0, or -1) corresponding to the sign of a number. (e.g.
KJT> numSign = Sgn(numSign) )
KJT> Does Visual C++ have a similar function? If so, in what header
Use the ?: operator, for example:
int s, i;
i = -647; /* set i to some value */
s = (i =0 */
You could even define a simple macro to perform the same task as
your VB function:
#define Sgn(x) (x 0 ? 1 : 0)
Then use the macro like this:
int s, i;
i = 8100 /* set i to some value */
s = Sgn(i); /* get the sign of i */
Wolvaen
... Basic programmers never die. They just GOSUB without RETURN!
--- Blue Wave/RA v2.20
---------------
* Origin: The Gate, Melbourne Australia, +61-3-9809-5097 33.6k (3:633/159)
|