sign()

Scalar. Determines whether a given value is positive or negative.

Syntax

sign ( value )

Parameters

value

Any type that can have a sign (integer, float, long, interval, money).

Usage

Determines whether a given value is positive or negative. The function returns 1 if the value is positive, -1 if the value is negative, and 0 otherwise. The argument can be any type that has a sign, and the function returns an integer.

Example

sign ( cosd(45.0) ) returns 1.