diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2011-12-10 10:12:37 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2011-12-10 10:12:37 -0800 |
commit | b2a9e9235656317a5608c2ef837ed0d7a4fd43ae (patch) | |
tree | 1523228c1d50d05b019362df8907bcf6ead5baa9 /lib.c | |
parent | c97acc792a69cbcabfa05150b639ef6b11f877f9 (diff) | |
download | txr-b2a9e9235656317a5608c2ef837ed0d7a4fd43ae.tar.gz txr-b2a9e9235656317a5608c2ef837ed0d7a4fd43ae.tar.bz2 txr-b2a9e9235656317a5608c2ef837ed0d7a4fd43ae.zip |
* arith.c: File is now generated using TXR.
(NOOP): New macro.
(plus): Use NOOP macro.
(minus, neg): Function moved here from lib.c and rewritten
for bignum support.
* lib.c (minus, neg): Functions removed.
* arith.txr: New file.
Diffstat (limited to 'lib.c')
-rw-r--r-- | lib.c | 18 |
1 files changed, 0 insertions, 18 deletions
@@ -837,24 +837,6 @@ val plusv(val nlist) return reduce_left(func_n2(plus), nlist, num(0), nil); } -val minus(val anum, val bnum) -{ - cnum a = c_num(anum); - cnum b = c_num(bnum); - - numeric_assert (b != NUM_MIN || NUM_MIN == -NUM_MAX); - numeric_assert (a <= 0 || -b <= 0 || NUM_MAX + b >= a); - numeric_assert (a >= 0 || -b >= 0 || NUM_MIN + b <= a); - - return num(a - b); -} - -val neg(val anum) -{ - cnum n = c_num(anum); - return num(-n); -} - val minusv(val minuend, val nlist) { if (nlist) |