Skip to content

Float

A float is a floating-point number, which means it is a number that has a decimal place. It is stored as a single-precision 32-bit IEEE 754 floating-point.

Examples

More on the built-in functions can be found in the Built-in Function section

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
var float = 1.5

# Operations
var float = float + 1.5  # 3.0
var float = float - 1.2  # 2.8
var float = float * 2.0  # 5.6
var float = float / 3.2  # 1.75
var float = float ^ 2.0  # 3.0625
var float = -float  # -3.0625

# Check if type is a float
isInteger(float)  # 1

# Check if not 0.0 (falsy or truthy)
isTrue(float)  # 0