# SIGN()

Sign of a number

Syntax

  SIGN (nNumber) -> nSign

Arguments

  <nNumber> a number

Returns

  <nSign> sign of <nNumber>

Description

  The function SIGN() determines the sign of <nNumber>. If <nNumber> is > 0, then SIGN(<nNumber>) returns 1 If <nNumber> is < 0, then SIGN(<nNumber>) returns -1 If <nNumber> is == 0, then SIGN(<nNumber>) returns 0

Examples

          ? sign (1.1)   --> 1
          ? sign (-1.1)  --> -1
          ? sign (0.0)  --> 0
    Tests
          sign (1.1)  == 1
          sign (-1.1) == -1
          sign (0.0)  == 0

Status

  Ready

Compliance

  SIGN() is compatible with CT3's SIGN().

Platforms

  All

Files

  Source is math.c, library is libct.