aboutsummaryrefslogtreecommitdiffstats
path: root/lib/scheme/base/80-number.csc
diff options
context:
space:
mode:
Diffstat (limited to 'lib/scheme/base/80-number.csc')
-rw-r--r--lib/scheme/base/80-number.csc14
1 files changed, 3 insertions, 11 deletions
diff --git a/lib/scheme/base/80-number.csc b/lib/scheme/base/80-number.csc
index 171bbd0..4b83874 100644
--- a/lib/scheme/base/80-number.csc
+++ b/lib/scheme/base/80-number.csc
@@ -170,11 +170,7 @@
(define (add2 x y)
(define z (call-builtin add x y))
(if (negative? z)
- (values 1 (call-builtin add
- 1
- (call-builtin add
- z
- small-int-max)))
+ (values 1 (call-builtin sub z small-int-min))
(values 0 z)))
@@ -289,9 +285,7 @@
(if (int-negative? x)
(begin
(vector-set! out-digits i
- (call-builtin add
- 1
- (call-builtin add x small-int-max)))
+ (call-builtin sub x small-int-min))
(loop (+ 1 i) -1))
(begin
(vector-set! out-digits i x)
@@ -303,9 +297,7 @@
(if (int-negative? x)
(begin
(vector-set! out-digits i
- (call-builtin add
- 1
- (call-builtin add x small-int-max)))
+ (call-builtin sub x small-int-min))
(loop (+ 1 i) -1))
(begin
(vector-set! out-digits i x)