Sign()

Syntax

Result.f = Sign(Number.f)
Description
Returns a floating-point value representing the sign of the given number.

Parameters

Number.f The number to get the sign from.

Return value

- Returns 0 if Number is zero.
- Returns 1 if Number is positive.
- Returns -1 if Number is negative.

Remarks

This function can handle float and double values.

Example

  Debug Sign(-7)   ; will display -1.0
  Debug Sign(0)    ; will display 0.0
  Debug Sign(7)    ; will display 1.0

See Also

Abs()

Supported OS

All

<- Round() - Math Index - Sin() ->