From 3f7753149eaf2c625537b569169fe47c58b57c73 Mon Sep 17 00:00:00 2001 From: Justin Ethier Date: Tue, 21 Feb 2017 00:53:59 -0500 Subject: [PATCH] Use Cyc_remainder --- scheme/base.sld | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/scheme/base.sld b/scheme/base.sld index 51890350..0241a612 100644 --- a/scheme/base.sld +++ b/scheme/base.sld @@ -1058,23 +1058,7 @@ ;; Apparently C % is actually the remainder, not modulus (define-c remainder "(void *data, int argc, closure _, object k, object num1, object num2)" - " int i, j; - Cyc_check_num(data, num1); - Cyc_check_num(data, num2); - if (obj_is_int(num1)) { - i = obj_obj2int(num1); - } else /* Must be double: if (type_of(num1) == double_tag)*/ { - i = ((double_type *)num1)->value; - } - if (obj_is_int(num2)) { - j = obj_obj2int(num2); - } else /* Must be double: if (type_of(num2) == double_tag)*/ { - j = ((double_type *)num2)->value; - } - { - object result = obj_int2obj(i % j); - return_closcall1(data, k, result); - }") + " Cyc_remainder(data, k, num1, num2); ") ;; From chibi scheme. Cannot use C % operator (define (modulo a b) (let ((res (remainder a b)))