Sgn

Determines the sign of a number. Returns 1 if number is positive; 0 if number is 0; and -1 if number is negative.

See also Abs.

Syntax

Sgn(number)
number

Any number.

Examples

<!--- This example shows the use of Sgn --->
<HTML>
<HEAD>
<TITLE>Sgn Example</TITLE>
</HEAD>

<BODY>
<H3>Sgn Example</H3>

<P>Sgn determines the sign of a number.  Returns
1 if number is positive; 0 if number is 0; and -1 if 
number is negative.

<P>Sgn(14): <CFOUTPUT>#Sgn(14)#</CFOUTPUT>
<P>Sgn(21-21): <CFOUTPUT>#Sgn(21-21)#</CFOUTPUT>
<P>Sgn(-0.007): <CFOUTPUT>#Sgn(-0.007)#</CFOUTPUT>

</BODY>
</HTML>       



1