PH> int s, i;
PH> i = -647; /* set i to some value */
PH> s = (i =0 */
PH> You could even define a simple macro to perform the same task as
PH> your VB function:
by the way this SGN is afaik standard in all versions of BASIC or at
least TRS-80 Color Basic, GWBASIC, QuickBASIC, PowerBASIC, and most
others.
PH> #define Sgn(x) (x 0 ? 1 : 0)
i would recommend a non-macro one, that avoids nasty side effects,
enforces type-checking, and clears out most nameconflicts:
template inline int sgn (Any x) { return x0; }
matju
--- Terminate 4.00/Pro
---------------
* Origin: The Lost Remains Of SatelliteSoft BBS (1:163/215.42)
|