FUNCTION sign, x, NO_PAR_CHECK = no_par_check ; Description: For an input parameter "x", the function determines whether the parameter is ; positive, negative or zero, returning a value of "1", "-1" or "0" respectively. ; The input parameter "x" may be a scalar, vector or array. ; ; Input Parameters: ; ; x - INTEGER/LONG/FLOAT/DOUBLE SCALAR/VECTOR/ARRAY - The value of the independent variable. ; ; Return Value: ; ; The return value is a SCALAR/VECTOR/ARRAY (the same as the input parameter) of INTEGER ; type that takes a value of "1" where the input parameter is positive, "-1" where the ; input parameter is negative, and "0" where the input parameter is zero. If the input ; parameter is not of the correct number type, then the function will return a value of "-2". ; ; Keywords: ; ; If the keyword NO_PAR_CHECK is set (as "/NO_PAR_CHECK"), then the program will not perform ; parameter checking on the input parameter, reducing program overheads. ; ; Author: Dan Bramich (dan.bramich@hotmail.co.uk) ; ; History: ; ; 20/04/2009 - Module created (dmb) ;Perform parameter checking if not instructed otherwise ;Set positive elements of the input parameter to "1", and negative elements of the input ;parameter to "-1" ;Return the sign of the input parameter