summaryrefslogtreecommitdiffstats
path: root/lib.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2011-12-11 19:56:03 -0800
committerKaz Kylheku <kaz@kylheku.com>2011-12-11 19:56:03 -0800
commit68fbc5322e282f41e2ee8c84cc16f6b6a4d39670 (patch)
tree8a8f3a52a29e05d9267d45b7774288450aaffee4 /lib.c
parentaf4986ea5e82d32f9699d41781f60d9b77ba9748 (diff)
downloadtxr-68fbc5322e282f41e2ee8c84cc16f6b6a4d39670.tar.gz
txr-68fbc5322e282f41e2ee8c84cc16f6b6a4d39670.tar.bz2
txr-68fbc5322e282f41e2ee8c84cc16f6b6a4d39670.zip
Bignum division implemented. More portability bugs found in MPI:
code like 1 << n, where n exceeds the width of the type int. * arith.c (trunc): New function, reimplementation of removed trunc from lib.c. * lib.c (trunc): Removed. * mpi-patches/fix-bad-shifts: New file.
Diffstat (limited to 'lib.c')
-rw-r--r--lib.c14
1 files changed, 0 insertions, 14 deletions
diff --git a/lib.c b/lib.c
index 1c510fd2..cd9d8edd 100644
--- a/lib.c
+++ b/lib.c
@@ -857,20 +857,6 @@ val mulv(val nlist)
return reduce_left(func_n2(mul), cdr(nlist), car(nlist), nil);
}
-val trunc(val anum, val bnum)
-{
- cnum a = c_num(anum);
- cnum b = c_num(bnum);
-
- numeric_assert (b != 0);
-
- {
- cnum result = a / b;
- numeric_assert (result <= NUM_MAX);
- return num(result);
- }
-}
-
val mod(val anum, val bnum)
{
cnum a = c_num(anum);