Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

Analytics and Notifications for PI System Explorer (PI Server 2018)

Sgn

  • Last UpdatedOct 04, 2024
  • 1 minute read

Return an indicator of the numerical sign of a number.

Syntax

Sgn(x)

Arguments

  • x

    Must be an integer or real number

Returns

-1 if x < 0; 0 if x = 0; 1 if x > 0

Exceptions

If x is not an integer or real number, returns an error value

Example

  • Sgn(1.1)

    [Returns 1]

  • Sgn(0)

    [Returns 0]

  • Sgn(-0.1)

    [Returns -1]

  • Sgn('att1')

    [Returns 1 if the value of 'att1' is positive, 0 if it equals 0, and -1 if it is negative]

In This Topic
TitleResults for “How to create a CRG?”Also Available in