Sgn

Description

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

Category

Mathematical functions

Syntax

Sgn(number) 

See also

Abs

Parameters

Parameter
Description
number
A number

Example

<!--- 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>