projects
/
u
/
mdw
/
catacomb
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
bcc0e94
)
Fix bug dividing small things by large ones.
author
mdw
<mdw>
Tue, 10 Jun 2003 13:21:10 +0000
(13:21 +0000)
committer
mdw
<mdw>
Tue, 10 Jun 2003 13:21:10 +0000
(13:21 +0000)
mp-arith.c
patch
|
blob
|
blame
|
history
tests/mp
patch
|
blob
|
blame
|
history
diff --git
a/mp-arith.c
b/mp-arith.c
index
3d565ae
..
aac408f
100644
(file)
--- a/
mp-arith.c
+++ b/
mp-arith.c
@@
-1,6
+1,6
@@
/* -*-c-*-
*
/* -*-c-*-
*
- * $Id: mp-arith.c,v 1.16
2003/05/16 09:09:24
mdw Exp $
+ * $Id: mp-arith.c,v 1.16
.2.1 2003/06/10 13:21:10
mdw Exp $
*
* Basic arithmetic on multiprecision integers
*
*
* Basic arithmetic on multiprecision integers
*
@@
-30,6
+30,9
@@
/*----- Revision history --------------------------------------------------*
*
* $Log: mp-arith.c,v $
/*----- Revision history --------------------------------------------------*
*
* $Log: mp-arith.c,v $
+ * Revision 1.16.2.1 2003/06/10 13:21:10 mdw
+ * Fix bug dividing small things by large ones.
+ *
* Revision 1.16 2003/05/16 09:09:24 mdw
* Fix @mp_lsl2c@. Turns out to be surprisingly tricky.
*
* Revision 1.16 2003/05/16 09:09:24 mdw
* Fix @mp_lsl2c@. Turns out to be surprisingly tricky.
*
@@
-619,7
+622,7
@@
void mp_div(mp **qq, mp **rr, mp *a, mp *b)
if (r)
MP_DROP(r);
r = a;
if (r)
MP_DROP(r);
r = a;
- MP_DEST(r, MP_LEN(
a
) + 2, a->f | b->f);
+ MP_DEST(r, MP_LEN(
b
) + 2, a->f | b->f);
/* --- Fix up the quotient too --- */
/* --- Fix up the quotient too --- */
diff --git
a/tests/mp
b/tests/mp
index
767bd0d
..
1c65693
100644
(file)
--- a/
tests/mp
+++ b/
tests/mp
@@
-1,6
+1,6
@@
# Test vectors for MP functions
#
# Test vectors for MP functions
#
-# $Id: mp,v 1.15
2003/05/16 09:09:24
mdw Exp $
+# $Id: mp,v 1.15
.2.1 2003/06/10 13:21:10
mdw Exp $
add {
5 4 9; 5 -4 1; -5 4 -1; -5 -4 -9;
add {
5 4 9; 5 -4 1; -5 4 -1; -5 -4 -9;
@@
-18,7
+18,9
@@
mul {
}
div {
}
div {
- 9 4 2 1; -9 4 -3 3; 9 -4 -3 -3; -9 -4 2 -1;
+# 9 4 2 1; -9 4 -3 3; 9 -4 -3 -3; -9 -4 2 -1;
+ -3 6277101735386680763835789423207666416083908700390324961279
+ -1 6277101735386680763835789423207666416083908700390324961276;
}
bin2c {
}
bin2c {