|
|
|
| 6 March 2002 | Abs() |
| Author | ScriptLogic Corporation |
| Action | Mathematical absolute value. |
| Syntax | Abs (expression) |
| Parameters | |
| Remarks | Due to popular demand (and the introduction of floating point support), KiXtart 4.1 will include this function nativley. |
| Returns | Returns the absolute value of the expression. |
| Dependencies | None. |
| Examples | $result=abs(-3) $x=10*10-145 $result=abs($x) |
| Source |
FUNCTION Abs ($expr)
;returns the absolute value of a number
$expr=0+$expr
IF ($expr < 0)
$expr=-1*$expr
ENDIF
$abs=$expr
ENDFUNCTION ; - Abs -
|
|
|
|