Skip to content
drewmccluskey edited this page Jan 9, 2019 · 3 revisions

sign

Returns the sign of n

Syntax:

sign(n)
Argument Description
Real n The value to sign

Returns: int

Description:

This function returns whether a number is positive, negative or neither and returns 1, -1, or 0 respectively.

Example:

int number = 5;
var quality = sign(number); //return 1

This code will sign int number to var quality with returning value 1.

Example2:

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

Clone this wiki locally