Float

From the Fallout3 GECK Wiki
Jump to navigation Jump to search

In simplified terms, a float is a number that may have a fractional (or 'decimal point') part. For general information on floats, see the wikipedia article.

float MyFloat

set MyFloat to 0.5

Imprecision Warning[edit | edit source]

Beware that floats are imprecise in computer science due to the impossibility of expressing most fractions in binary.

For example, in standard decimal it is impossible to express the fraction '1/3'- it must be approximated (0.3333...). The same situation applies much more often in binary.

In general, this should not pose a problem in GECK context, but one should be weary testing floats for exact equality (==). To be safe, one should Floor before checking, or instead use '<=' or '>='.