ID:267668
 
I'm not sure what this procedure does. If anyone could tell me, it would be appreciated.

proc
sign(x) //Should get bonus points for being the most compact code in the world!
return ((x<0)?-1:((x>0)?1:0))

~~Dragon Lord~~

PS: Yes, I got this from AbyssDragon's Math library.
</0>
Unknown Person wrote:
I'm not sure what this procedure does. If anyone could tell me, it would be appreciated.

proc
sign(x) //Should get bonus points for being the most compact code in the world!
return ((x<0)?-1:((x>0)?1:0))

~~Dragon Lord~~

PS: Yes, I got this from AbyssDragon's Math library.

Returns -1 if x is under 0, 1 if it is over 0, or 0 if it is equal to 0.
The parenthesis in that proc are superfluous.