diff --git a/src/ikarus.boot b/src/ikarus.boot index 510ad70..e266b3c 100644 Binary files a/src/ikarus.boot and b/src/ikarus.boot differ diff --git a/src/ikarus.numerics.ss b/src/ikarus.numerics.ss index e8f156a..6c94cd5 100644 --- a/src/ikarus.numerics.ss +++ b/src/ikarus.numerics.ss @@ -100,7 +100,7 @@ (export + - * / zero? = < <= > >= add1 sub1 quotient remainder positive? expt gcd lcm numerator denominator exact-integer-sqrt quotient+remainder number->string string->number max - exact->inexact floor ceiling log flinexact floor ceiling log flnumber expt gcd lcm numerator denominator exact->inexact floor ceiling log exact-integer-sqrt max - flflonum x) (foreign-call "ikrt_fixnum_to_flonum" x)) @@ -1178,6 +1178,48 @@ (error 'flinexact 1)])) + + + (define fl- + (case-lambda + [(x y) + (if (flonum? x) + (if (flonum? y) + ($fl- x y) + (error 'fl- "~s is not a flonum" y)) + (error 'fl- "~s is not a flonum" x))] + [(x y z) + (fl- (fl- x y) z)] + [(x y z q . rest) + (let f ([ac (fl- (fl- (fl- x y) z) q)] [rest rest]) + (if (null? rest) + ac + (f (fl- ac (car rest)) (cdr rest))))] + [(x) + (if (flonum? x) + ($fl- (exact->inexact 0) x) + (error 'fl+ "~s is not a flonum" x))])) + (flcmp flfl= flfx= fxfl= flbn= bnfl= $fl=) (flcmp flfl< flfx< fxfl< flbn< bnfl< $fl<) (flcmp flfl> flfx> fxfl> flbn> bnfl> $fl>) diff --git a/src/makefile.ss b/src/makefile.ss index 5f54b4a..f9ffbd7 100755 --- a/src/makefile.ss +++ b/src/makefile.ss @@ -368,6 +368,8 @@ [fxlogor i] [fxlognot i] [flstring i] [string->flonum i] [- i r] @@ -382,7 +384,7 @@ [+ i r] [add1 i] [sub1 i] - [expt i] + [expt i r] [number? i r] [bignum? i] [ratnum? i]