aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJade Lovelace <lix@jade.fyi>2024-07-12 18:20:14 +0200
committerJade Lovelace <lix@jade.fyi>2024-07-13 00:59:33 +0200
commita8f443d96011c11ad726c2a28a37752bd56c12cc (patch)
treebd2d30a1e54217d9f79d17822aee61cda76bfdde
parent917c9bdee76e4a9ad997c2503230c363a8bc5750 (diff)
docs: update to define integer overflow
Change-Id: Ie8a1b31035f2d27a220e5df2e9e178ec3b39ee68
-rw-r--r--doc/manual/src/language/operators.md6
-rw-r--r--doc/manual/src/language/values.md3
2 files changed, 7 insertions, 2 deletions
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