~ chicken-core (chicken-5) /tests/fixnum-tests.scm
Trap1(import (chicken platform)2 (chicken fixnum))34(define (fxo+ x y) (##core#inline "C_i_o_fixnum_plus" x y))5(define (fxo- x y) (##core#inline "C_i_o_fixnum_difference" x y))67(define-syntax assert8 ;; compiling with -unsafe disables the original assert9 (ir-macro-transformer10 (lambda (e inj cmp)11 (apply12 (lambda (f)13 `(if (not ,f)14 (error "assert" ',f)))15 (cdr e)))))1617(assert (= 4 (fxo+ 2 2)))18(assert (= -26 (fxo+ 74 -100)))19(assert (= 1073741823 (fxo+ #x3ffffffe 1)))20(assert21 (if (feature? #:64bit)22 (not (fxo+ #x3fffffffffffffff 1))23 (not (fxo+ #x3fffffff 1))))24(assert (= 4 (fxo- 6 2)))25(assert (= -4 (fxo- 1000 1004)))26(assert (= 2004 (fxo- 1000 -1004)))27(assert28 (if (feature? #:64bit)29 (= -4611686018427387904 (fxo- (- #x3fffffffffffffff) 1))30 (= -1073741824 (fxo- (- #x3fffffff) 1))))31(assert32 (if (feature? #:64bit)33 (not (fxo- (- #x3fffffffffffffff) 2))34 (not (fxo- (- #x3fffffff) 2))))3536(assert (= (modulo -3 4) (fxmod -3 4)))