Returns the sign of n
sign(n)
Returns: int
int
This function returns whether a number is positive, negative or neither and returns 1, -1, or 0 respectively.
int number = 5; var quality = sign(number); //return 1
This code will sign int number to var quality with returning value 1.
var
int number = -5; var quality = sign(number); //return -1
This code will sign int number to var quality with returning value -1.
Back to number_functions
There was an error while loading. Please reload this page.