math/
sign.pro
top source sign
Math
result = sign(x)
Returns the sign of the argument.
Return value
Returns 1 where X is positive, 0 where X is zero, and -1 where X is negative.
Parameters
- x in
Numerical argument (may be an array).
Examples
IDL> PRINT, SIGN([-10,0,25])
-1 0 1
Author information
- History:
Written by: Jeremy Bailin 12 June 2008 Public release in JBIU 13 June 2008 Re-written to omit FOR loop (thanks to Brian Larsen for the suggestion).
File attributes
| Modification date: | Wed Apr 15 16:07:59 2009 |
| Lines: | 42 |
![[attach.png]](../idldoc-resources/attach.png)