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:
parent
7b6622d733
commit
bf050d9e96
2 changed files with 13 additions and 2 deletions
|
@ -183,6 +183,13 @@ This section covers syntax and semantics of the Nix language.
|
|||
Numbers, which can be *integers* (like `123`) or *floating point*
|
||||
(like `123.43` or `.27e13`).
|
||||
|
||||
Integers in the Nix language are 64-bit [two's complement] signed integers, with a range of -9223372036854775808 to 9223372036854775807, inclusive.
|
||||
|
||||
[two's complement]: https://en.wikipedia.org/wiki/Two%27s_complement
|
||||
|
||||
Note that negative numeric literals are actually parsed as unary negation of positive numeric literals.
|
||||
This means that the minimum integer `-9223372036854775808` cannot be written as-is as a literal, since the positive number `9223372036854775808` is one past the maximum range.
|
||||
|
||||
See [arithmetic] and [comparison] operators for semantics.
|
||||
|
||||
[arithmetic]: ./operators.md#arithmetic
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue