Numbers, precision and errors
Choose a representation and handle rejected calculations explicitly.
Read a Scientific Number
FScientificNumber(1.25, 3) means 1250. Finite nonzero values normalize to 1 <= abs(Base) < 10. Zero has base and exponent zero. The exponent is int64; the mantissa has double precision. A wide range does not provide arbitrary-precision arithmetic.
Check the result
Use Is Success or Get Error before committing a computed value. Checked conversions and Safe operations also return success/error outputs. Errors propagate through arithmetic rather than silently becoming zero.
| Calculation | Expected result |
|---|---|
| 2000 + 3000 | 5000 |
| 2000 × 3000 | 6000000 |
| 3000 / 3 | 1000 |
| 2 to the power 10 | 1024 |
| Square root of 144 | 12 |
| 2000 / 0 | DivisionByZero |
| Invalid numeric text | ParseError |
Use checked conversions at float/double boundaries. A valid large-range number can still overflow the destination type.
Idle Mode
Idle Mode is disabled by default. When enabled, it rejects negative values without clamping; zero and positive fractions remain valid. A negative exponent represents a fraction, not a negative value. Change the setting before using the numeric system and restart after changing it. Test -2, 0.25 and 0 with each policy when your gameplay depends on these cases.
Resource rules and display
2000 / 4000 = 0.5, normalized as (5, -1), is valid in both modes. Fixed formatting with zero decimal places only changes text; it does not make the stored value an integer. For indivisible units, validate the value or explicitly apply Floor, Ceil or Round according to purchase rules. Avoid constraining every calculation for a rule that belongs to one wallet.
Arrays
For [10, 20, 30, 40, 50], Sum Of Array, Average Of Array, Min Of Array and Max Of Array should return 150, 30, 10 and 50. Inspect failures for empty or invalid input rather than assuming every array has a usable aggregate.
Keep authoritative values in the ordinary or Safe representation. Use Packed only where an approximate compact representation is appropriate.