diff --git a/doc/manual/src/language/operators.md b/doc/manual/src/language/operators.md index 418d0349f..ff09e739f 100644 --- a/doc/manual/src/language/operators.md +++ b/doc/manual/src/language/operators.md @@ -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]. diff --git a/doc/manual/src/language/values.md b/doc/manual/src/language/values.md index 2ae3e143a..f02ef2597 100644 --- a/doc/manual/src/language/values.md +++ b/doc/manual/src/language/values.md @@ -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