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

Function syntax

Sgn(number)

See also

Abs

Parameters

Parameter

Description

number

A number

Example

<h3>Sgn Example</h3> 
<p>Sgn determines the sign of a number. Returns 1 if number is positive; 
0 if number is 0; -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>

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License  Twitter™ and Facebook posts are not covered under the terms of Creative Commons.

Legal Notices   |   Online Privacy Policy