Cheddar Documentation
Search…
Cheddar Documentation
Introduction
Syntax
Literals
Mathematics
Addition
Subtraction
Multiplication
Division
Exponentiation
Remainder
Negation
Sign
Root
Bitwise AND
Bitwise OR
Bitwise XOR
Bitwise NOT
Bitwise Left Shift
Bitwise Right Shift
Variables
Functions
Default Operators
Control Flow
Standard Library
Developing
Powered By GitBook
Sign

Syntax

1
sign x
Copied!

Explanation

sign returns the sign of the operand as -1, 0, or 1

Examples

1
sign 1 // 1
2
sign 100 // 1
3
sign 0 // 0
4
sign -1 // -1
5
sign -100 // -1
Copied!
Previous
Negation
Next
Root
Last modified 1yr ago
Copy link
Contents
Syntax
Explanation
Examples