Sign

From MiniScript Wiki
Jump to navigation Jump to search

sign returns -1 for negative numbers, 1 for positive numbers, and 0 for zero.

Arguments

Parameter Name Default Value Meaning
x number number to get the sign of

Example

sign(-42.6)		// returns -1