* Added flsqrt.
This commit is contained in:
parent
ded64db389
commit
89fd9d0a23
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
|
||||
quotient+remainder number->string string->number min max
|
||||
exact->inexact floor ceiling round log fl=? fl<? fl<=? fl>?
|
||||
fl>=? fl+ fl- fl* fl/)
|
||||
fl>=? fl+ fl- fl* fl/ flsqrt)
|
||||
(import
|
||||
(ikarus system $fx)
|
||||
(ikarus system $flonums)
|
||||
|
@ -116,7 +116,7 @@
|
|||
string->number expt gcd lcm numerator denominator
|
||||
exact->inexact floor ceiling round log
|
||||
exact-integer-sqrt min max
|
||||
fl=? fl<? fl<=? fl>? fl>=? fl+ fl- fl* fl/))
|
||||
fl=? fl<? fl<=? fl>? fl>=? fl+ fl- fl* fl/ flsqrt))
|
||||
|
||||
(define (fixnum->flonum x)
|
||||
(foreign-call "ikrt_fixnum_to_flonum" x))
|
||||
|
@ -1457,6 +1457,12 @@
|
|||
[(ratnum? x) (/ (sqrt ($ratnum-n x)) (sqrt ($ratnum-d x)))]
|
||||
[else (error 'sqrt "unsupported ~s" x)])))
|
||||
|
||||
(define flsqrt
|
||||
(lambda (x)
|
||||
(if (flonum? x)
|
||||
(foreign-call "ikrt_fl_sqrt" x)
|
||||
(error 'flsqrt "~s is not a flonum" x))))
|
||||
|
||||
(define exact-integer-sqrt
|
||||
(lambda (x)
|
||||
(define who 'exact-integer-sqrt)
|
||||
|
|
|
@ -376,6 +376,7 @@
|
|||
[fl* i rfl]
|
||||
[fl- i rfl]
|
||||
[fl/ i rfl]
|
||||
[flsqrt i rfl]
|
||||
[fixnum->string i]
|
||||
[string->flonum i]
|
||||
[- i r]
|
||||
|
|
Loading…
Reference in New Issue