sgn

Determines the sign of a number.

sgn(number) → returns numeric

Argument Reference

number numeric
Required

Examples
Sample code invoking the sgn function

sgn(0.3)

Expected Result: 1

sgn(0)

Expected Result: 0

sgn(-0.3)

Expected Result: -1

Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.

Fork me on GitHub