chiark
/
gitweb
/
~mdw
/
catacomb
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
fc8f52d
)
math/mpreduce.c: Fix some typos in commentary.
author
Mark Wooding
<mdw@distorted.org.uk>
Wed, 12 Mar 2014 16:20:06 +0000
(16:20 +0000)
committer
Mark Wooding
<mdw@distorted.org.uk>
Wed, 12 Mar 2014 16:20:06 +0000
(16:20 +0000)
math/mpreduce.c
patch
|
blob
|
blame
|
history
diff --git
a/math/mpreduce.c
b/math/mpreduce.c
index 2193de6dd5e7201ae651448a1dce0fa0a4be884d..871d3a42826c6928a4b737eac18be79f4e851f0f 100644
(file)
--- a/
math/mpreduce.c
+++ b/
math/mpreduce.c
@@
-47,7
+47,7
@@
DA_DECL(instr_v, mpreduce_instr);
*
* Suppose %$x = x' + z 2^k$%, where %$k \ge n$%; then
* %$x \equiv x' + d z 2^{k-n} \pmod p$%. We can use this to trim the
*
* Suppose %$x = x' + z 2^k$%, where %$k \ge n$%; then
* %$x \equiv x' + d z 2^{k-n} \pmod p$%. We can use this to trim the
- * representation of %$x$%; each time, we reduce %$x$% by a mu
tl
iple of
+ * representation of %$x$%; each time, we reduce %$x$% by a mu
lt
iple of
* %$2^{k-n} p$%. We can do this in two passes: firstly by taking whole
* words off the top, and then (if necessary) by trimming the top word.
* Finally, if %$p \le x < 2^n$% then %$0 \le x - p < p$% and we're done.
* %$2^{k-n} p$%. We can do this in two passes: firstly by taking whole
* words off the top, and then (if necessary) by trimming the top word.
* Finally, if %$p \le x < 2^n$% then %$0 \le x - p < p$% and we're done.
@@
-210,7
+210,7
@@
int mpreduce_create(mpreduce *r, mp *p)
* a perfect power of two, and %$d = 0$%, so again there is nothing to do.
*
* In the remaining case, we have decomposed @x@ as %$2^{n-1} + d$%, for
* a perfect power of two, and %$d = 0$%, so again there is nothing to do.
*
* In the remaining case, we have decomposed @x@ as %$2^{n-1} + d$%, for
- * some positive %$d%, which is unfortu
an
te: if we're asked to reduce
+ * some positive %$d%, which is unfortu
na
te: if we're asked to reduce
* %$2^n$%, say, we'll end up with %$-d$% (or would do, if we weren't
* sticking to unsigned arithmetic for good performance). So instead, we
* rewrite this as %$2^n - 2^{n-1} + d$% and everything will be good.
* %$2^n$%, say, we'll end up with %$-d$% (or would do, if we weren't
* sticking to unsigned arithmetic for good performance). So instead, we
* rewrite this as %$2^n - 2^{n-1} + d$% and everything will be good.