parent
2dad5b473e
commit
817851f3d2
BIN
src/ikarus.boot
BIN
src/ikarus.boot
Binary file not shown.
|
@ -102,7 +102,7 @@
|
||||||
positive? expt gcd lcm numerator denominator exact-integer-sqrt
|
positive? expt gcd lcm numerator denominator exact-integer-sqrt
|
||||||
quotient+remainder number->string string->number min max
|
quotient+remainder number->string string->number min max
|
||||||
exact->inexact floor ceiling round log fl=? fl<? fl<=? fl>?
|
exact->inexact floor ceiling round log fl=? fl<? fl<=? fl>?
|
||||||
fl>=? fl+ fl-)
|
fl>=? fl+ fl- fl*)
|
||||||
(import
|
(import
|
||||||
(ikarus system $fx)
|
(ikarus system $fx)
|
||||||
(ikarus system $flonums)
|
(ikarus system $flonums)
|
||||||
|
@ -116,7 +116,7 @@
|
||||||
string->number expt gcd lcm numerator denominator
|
string->number expt gcd lcm numerator denominator
|
||||||
exact->inexact floor ceiling round log
|
exact->inexact floor ceiling round log
|
||||||
exact-integer-sqrt min max
|
exact-integer-sqrt min max
|
||||||
fl=? fl<? fl<=? fl>? fl>=? fl+ fl-))
|
fl=? fl<? fl<=? fl>? fl>=? fl+ fl- fl*))
|
||||||
|
|
||||||
(define (fixnum->flonum x)
|
(define (fixnum->flonum x)
|
||||||
(foreign-call "ikrt_fixnum_to_flonum" x))
|
(foreign-call "ikrt_fixnum_to_flonum" x))
|
||||||
|
@ -1207,7 +1207,7 @@
|
||||||
(if (flonum? x)
|
(if (flonum? x)
|
||||||
x
|
x
|
||||||
(error 'fl+ "~s is not a flonum" x))]
|
(error 'fl+ "~s is not a flonum" x))]
|
||||||
[() (exact->inexact 1)]))
|
[() (exact->inexact 0)]))
|
||||||
|
|
||||||
|
|
||||||
(define fl-
|
(define fl-
|
||||||
|
@ -1230,6 +1230,27 @@
|
||||||
($fl- (exact->inexact 0) x)
|
($fl- (exact->inexact 0) x)
|
||||||
(error 'fl+ "~s is not a flonum" x))]))
|
(error 'fl+ "~s is not a flonum" x))]))
|
||||||
|
|
||||||
|
(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)
|
||||||
|
x
|
||||||
|
(error 'fl* "~s is not a flonum" x))]
|
||||||
|
[() (exact->inexact 1)]))
|
||||||
|
|
||||||
(flcmp flfl= flfx= fxfl= flbn= bnfl= $fl=)
|
(flcmp flfl= flfx= fxfl= flbn= bnfl= $fl=)
|
||||||
(flcmp flfl< flfx< fxfl< flbn< bnfl< $fl<)
|
(flcmp flfl< flfx< fxfl< flbn< bnfl< $fl<)
|
||||||
(flcmp flfl> flfx> fxfl> flbn> bnfl> $fl>)
|
(flcmp flfl> flfx> fxfl> flbn> bnfl> $fl>)
|
||||||
|
|
|
@ -373,6 +373,7 @@
|
||||||
[fl>? i rfl]
|
[fl>? i rfl]
|
||||||
[fl>=? i rfl]
|
[fl>=? i rfl]
|
||||||
[fl+ i rfl]
|
[fl+ i rfl]
|
||||||
|
[fl* i rfl]
|
||||||
[fl- i rfl]
|
[fl- i rfl]
|
||||||
[fixnum->string i]
|
[fixnum->string i]
|
||||||
[string->flonum i]
|
[string->flonum i]
|
||||||
|
|
Loading…
Reference in New Issue