docs: update to define integer overflow

Change-Id: Ie8a1b31035f2d27a220e5df2e9e178ec3b39ee68
This commit is contained in:
jade 2024-07-12 18:20:14 +02:00
parent 917c9bdee7
commit a8f443d960
2 changed files with 7 additions and 2 deletions

View file

@ -59,8 +59,10 @@ The result is a [Boolean] value.
## 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.
Integer overflow (of 64-bit signed integers) and division by zero are defined to throw an error.
See also [Comparison] and [Equality].

View file

@ -85,6 +85,9 @@
Numbers, which can be *integers* (like `123`) or *floating point*
(like `123.43` or `.27e13`).
Integers in the Nix language are 64-bit signed integers.
Integer overflow is defined to throw an error.
See [arithmetic] and [comparison] operators for semantics.
[arithmetic]: ./operators.md#arithmetic