Equivelent of BASIC SGN function
| From: | Gary Landers | Date: | Sun, 13 Aug 2000 19:37:29 +0000 |
| Subject: | Equivelent of BASIC SGN function | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-11529@lists.php.net to get a copy of this message | ||
I am recoding a Basic program into PHP
the program uses a SNG function which acts like this
SGN returns a value indicating the sign of a numeric expression (1 if the
expression is positive, 0 if it is zero, or -1 if it is negative).
Example:
PRINT SGN(1), SGN(-1), SGN(0)
Output is:
1 -1 0
I cant find a like function in PHP and the only solution I come up with is
lengthy.
---
Gary Landers