aboutsummaryrefslogtreecommitdiffstats
path: root/man
diff options
context:
space:
mode:
Diffstat (limited to 'man')
-rw-r--r--man/zdivmod.328
-rw-r--r--man/zmod.315
2 files changed, 4 insertions, 39 deletions
diff --git a/man/zdivmod.3 b/man/zdivmod.3
index d63405a..f0cd9e4 100644
--- a/man/zdivmod.3
+++ b/man/zdivmod.3
@@ -30,34 +30,6 @@ gets
Mod
.IR divisor .
.P
-Be aware,
-.I remainder
-gets
-.RI | dividend |
-Mod
-.RI | divisor |,
-this means that it is only guaranteed to be true that
-.I dividend
-=
-.I quotient
-⋅
-.I divisor
-+
-.IR remainder
-if
-.I dividend
-and
-.I divisor
-are both non-negative.
-It is up to the user, to make the necessary adjustment to
-.I remainder
-to make this true or to satisfy any desired property. This
-exceptional behaviour has been choosen because it is the
-simplies, works just fine if you are working with natural
-numbers only, and there are two many ways to define
-modulus; this one is advantages when you want to make
-adjustments, it is straight-forward.
-.P
It is safe to call
.B zdivmod
with non-unique parameters,
diff --git a/man/zmod.3 b/man/zmod.3
index a6cd21d..b2588d1 100644
--- a/man/zmod.3
+++ b/man/zmod.3
@@ -24,22 +24,15 @@ Mod
.P
The result
.RI ( remainder )
-is always non-negative. To be more precise,
-a Mod b = |a| Mod |b| for all integers a
+is negative if and only if the
+.I dividend
+is negative. To be more precise,
+a Mod b = (|a| Mod |b|) sgn a for all integers a
and b.
.P
It is safe to call
.B zmod
with non-unique parameters.
-.SH RATIONALE
-There are many ways to define modulus with
-negative integers. You have to select how the
-signness is selected, and when to invert
-(in respect to modulated addition) the remainder.
-The simplest way to implement modulus is to
-ignore the sign of the operands. This solution
-also makes it very easy for those that which
-to write a wrapper that changes the definition.
.SH SEE ALSO
.BR zdivmod (3),
.BR zstr (3),