24.2.10 Floating-point Operators

Poke is capable of interpreting uint<32>/uint<64> integers as single/double-precision floating-point numbers.

24.2.10.1 Floating-point Arithmetic Operators

The following left-associative binary floating-point arithmetic operators are supported in descending precedence order:

Unary minus .- is supported and is a right-associative operator.

Pre-increment, pre-decrement, post-increment and post-decrement operators .++ and .-- are also supported.

These operators resolve in unsigned integers of the same size of operands.

Examples:

(poke) stof ("3.14") .+ stof ("1")
0x40847ae2U
(poke) format ("%f32d", stof ("3.14") .+ stof ("1"))
"4.1400003"
(poke) stod ("3.14") .+ stod ("1")
0x40108f5c28f5c290UL
(poke) format ("%f64d", stod ("3.14") .+ stod ("1"))
"4.140000000000001"

24.2.10.2 Floating-point Relational Operators

The following binary floating-point relational operators are supported in descending precedence order:

These operators resolve in boolean values encoded as 32-bit integers: 0 meaning false and 1 meaning true.

(poke) stof ("3.14") .> stof ("1")
1
(poke) stod ("3.14") .== stod ("1")
0