title: “FLOAT Type” author: “Pierre Laplante laplante@plcb.ca” date: “2023-04-17” version: “1.0.0”
The FLOAT type represents a real number.
In mathematics, a real number is a value that can represent a quantity along a continuous line.
Real numbers include all rational numbers, such as integers (e.g., −5) and fractions (e.g., 4⁄3),
as well as all irrational numbers, such as √2 (1.41421356…, an irrational algebraic number) and π (3.14159265…, a transcendental number).
The internal representation of this type is similar to a float64 in the Go programming language.
LNUM [0-9]+
DNUM ([0-9]*[\.][0-9]+)|([0-9]+\.[0-9]*)
EXPONENT_DNUM (({LNUM}|{DNUM})[eE][+-]?{LNUM})
float = {DNUM}|{EXPONENT_DNUM}
res={{ a := .56; a; }}.
return
res=0.56.
res={{ a := 1.1; a; }}.
return
res=1.1.
res={{ a := 56.65; a; }}.
return
res=56.65.
res={{ a := 2.0e5; a; }}.
return
res=200000.
res={{ a := 2.0E-32; a; }}.
return
res=0.00000000000000000000000000000002.