Skip to content

Commit

Permalink
Merge pull request #63 from zyklotomic/patch-1
Browse files Browse the repository at this point in the history
Mention zero is neither postive nor negative in spec documentation
  • Loading branch information
huitseeker authored Jan 1, 2024
2 parents a83b031 + 1450dfe commit 2ed9f99
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion spec/v0-1.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ The mod operator `%` is a special case: `<e1>` and `<e2>` must evaluate to U64s.

Arithmetic operations on two Nums yield Nums and are treated as field operations done modulo `p`; division is field division.

Comparisons interpret Nums as signed. The first half ranging from `0` to `(p - 1)/2` is considered positive. The second half ranging from `(p - 1)/2 + 1` to `p - 1` is considered negative. For every positive `n`, there is a corresponding negative `m`, such that `n + m = 0`. The result is that the interpretation of signed Nums implied by the definition of < (etc.) is arithmetically consistent.
Comparisons interpret Nums as signed. The first half ranging from `0` exclusive to `(p - 1)/2` is considered positive. The second half ranging from `(p - 1)/2 + 1` to `p - 1` is considered negative. For every positive `n`, there is a corresponding negative `m`, such that `n + m = 0`. Furthermore, `0` is considered neither positive nor negative, and we have that `0 + 0 = 0`. The result is that the interpretation of signed Nums implied by the definition of < (etc.) is arithmetically consistent.

Arithmetic operations on two U64s yield U64s and are done modulo `2^64`; divison is integer division.

Expand Down

0 comments on commit 2ed9f99

Please sign in to comment.