1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-07 01:51:47 +02:00

docs: update to define integer overflow

Change-Id: Ie8a1b31035f2d27a220e5df2e9e178ec3b39ee68
This commit is contained in:
Jade Lovelace 2024-07-12 18:20:14 +02:00 committed by Jade Lovelace
parent 7b6622d733
commit bf050d9e96
2 changed files with 13 additions and 2 deletions

View file

@ -67,8 +67,12 @@ After evaluating *attrset* and *attrpath*, the computational complexity is O(log
## Arithmetic
Numbers are type-compatible:
Pure integer operations will always return integers, whereas any operation involving at least one floating point number return a floating point number.
Numbers will retain their type unless mixed with other numeric types:
Pure integer operations will always return integers, whereas any operation involving at least one floating point number returns a floating point number.
Evaluation of the following numeric operations throws an evaluation error:
- Division by zero
- Integer overflow, that is, any operation yielding a result outside of the representable range of [Nix language integers](./syntax.md#number-literal)
See also [Comparison] and [Equality].