How to find the sign of a value?

Blitz3D Forums/Blitz3D Programming/How to find the sign of a value?

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Doing speedtests though, I see that's it's much faster to just check if the variable is greater than zero.
starttime = MilliSecs()
For iter = 1 To 100000000
If Abs(variable) = variable
  ;variable is positive
Else
  ;variable is negative
EndIf
Next
Print MilliSecs() - starttime
starttime = MilliSecs()
For iter = 1 To 100000000
If variable > 0
  ;variable is positive
Else
  ;variable is negative
EndIf
Next
Print MilliSecs() - starttime
WaitKey()
End

711
266