PDA

View Full Version : Find out if Negative or Positive.


Morgoth
05-01-2003, 02:14 AM
What is the function to find out if a number is possitive or negative?

raf
05-01-2003, 09:36 AM
Morgoth,

you can use Sgn(number) for that.
Note : keep 0 in mind !

More info from helpfile
---------------------------------------------------
Description
Returns an integer indicating the sign of a number.
Syntax
Sgn(number)
The number argument can be any valid numeric expression.

Return Values
The Sgn function has the following return values:
If number is Sgn returns
Greater than zero 1
Equal to zero 0
Less than zero -1

Morgoth
05-01-2003, 01:18 PM
Thank you.