analysis/
mg_sign.pro
Routines
top mg_sign
result = mg_sign(x)
Return the sign of the values of an array: -1 for negative values, 0 for 0 values, 1 for positive values. The dimensions of the result are the same as the input array.
Return value
intarr
Parameters
- x in required type=numeric array
input array
Examples
For example, the following finds the sign of the values in a simple array:
IDL> print, mg_sign([-3.5, 0., 4.7])
-1 0 1
File attributes
Modification date: | Wed May 14 15:07:14 2014 |
Lines: | 4 |
Docformat: | rst rst |
Contact me if you have enhancement requests or bug fixes.