real
- comment
A 32-bit IEEE-754 float type.
- note
The equality
==and inequality!=operators are different for typereal.0.0 == 0.0009is true, effectively the precision is set to0.001(epsilon) in the Jass VM. As a result,0.0 == 0.001is false.However, the
!=operator does not have its accuracy limited, so0.0 != 0.0009will return true too. The inequality operator can be used to compare reals of arbitrary precision (as long they are actually different in binary).- note
In-depth analysis of floating-point behavior of
realin Jass: real Talk - Floats in Warcraft 3.- note
(2014) Typecast exploit conversion between real and integer: 100% accurate and pretty fast realToIndex and back.
- Source
- builtin-types.j (suggest an edit or discuss on Github)
- Source code
type real extends void- Search for