Sign

Navigation:  Appendices > Macro Language > Built-in Functions > All Functions (Alphabetical) >

Sign

Previous pageReturn to chapter overviewNext page

int = Sign(nNumber)

 

This macro function takes an integer as parameter and returns 1 if the number is positive, -1 if the number is negative, and 0 if the number is zero.

 

 Sign(20) // 1

 Sign(-30) // -1

 Sign(0) // 0

 

Note that the following is always true :

 

 nNumber == Sign(nNumber) * Abs(nNumber)

 

See also : Abs.

 


Topic 174330 updated on 01-Nov-2016.
Topic URL: http://www.qppstudio.net/webhelp/index.html?sign.htm