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 rejects negative values and nonzero values below one; it does not clamp them. Zero is allowed. 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.
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 graphics representation is appropriate.