diff --git a/src/ikarus.boot b/src/ikarus.boot index 4cf54f8..223183e 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 52dc5e8..eaffe45 100644 --- a/src/ikarus.numerics.ss +++ b/src/ikarus.numerics.ss @@ -10,17 +10,18 @@ inexact->exact exact $flonum-rational? $flonum-integer? $flzero? $flnegative? flpositive? flabs fixnum->flonum flsin flcos fltan flasin flacos flatan fleven? flodd? - flfloor flceiling flnumerator fldenominator flexp + flfloor flceiling flnumerator fldenominator flexp fllog flinteger? flonum-bytes flnan? flfinite? flinfinite?) (import (ikarus system $bytevectors) (ikarus system $fx) + (only (ikarus system $flonums) $fl>=) (ikarus system $bignums) (except (ikarus system $flonums) $flonum-signed-biased-exponent $flonum-rational? $flonum-integer?) (except (ikarus) inexact->exact exact flpositive? flabs fixnum->flonum flsin flcos fltan flasin flacos flatan fleven? flodd? - flfloor flceiling flnumerator fldenominator flexp + flfloor flceiling flnumerator fldenominator flexp fllog flinteger? flonum-parts flonum-bytes flnan? flfinite? flinfinite?)) (define (flonum-bytes f) @@ -278,6 +279,13 @@ (foreign-call "ikrt_fl_exp" x ($make-flonum)) (error 'flexp "~s is not a flonum" x))) + (define (fllog x) + (if (flonum? x) + (if ($fl>= x 0.0) + (foreign-call "ikrt_fl_log" x) + (error 'fllog "argument ~s should not be negative" x)) + (error 'fllog "~s is not a flonum" x))) + ) diff --git a/src/ikarus.predicates.ss b/src/ikarus.predicates.ss index cc9bd45..736d481 100644 --- a/src/ikarus.predicates.ss +++ b/src/ikarus.predicates.ss @@ -190,6 +190,8 @@ (and ($fx= n ($string-length y)) (string-loop x y 0 n))))] [(number? x) (and (number? y) (= x y))] + [(sys:bytevector? x) + (and (sys:bytevector? y) (bytevector=? x y))] [else #f])))) (define port? diff --git a/src/makefile.ss b/src/makefile.ss index 07ef479..5e1bf55 100755 --- a/src/makefile.ss +++ b/src/makefile.ss @@ -481,6 +481,7 @@ [flnumerator i rfl] [fldenominator i rfl] [flexp i rfl] + [fllog i rfl] [fixnum->string i] [string->flonum i] [- i r] @@ -507,6 +508,7 @@ [bignum? i] [ratnum? i] [integer? i r] + [real? i r] [flinteger? i] [flfinite? i] [flinfinite? i] diff --git a/src/todo-r6rs.ss b/src/todo-r6rs.ss index d5fb8f3..1e6d669 100755 --- a/src/todo-r6rs.ss +++ b/src/todo-r6rs.ss @@ -195,7 +195,7 @@ [rationalize S ba se] [real-part D ba se] [real-valued? S ba] - [real? S ba se] + [real? C ba se] [reverse C ba se] [round C ba se] [sin C ba se] @@ -326,7 +326,7 @@ [flfloor C fl] [flinfinite? C fl] [flinteger? C fl] - [fllog S fl] + [fllog C fl] [flmax C fl] [flmin C fl] [flmod D fl] @@ -339,7 +339,7 @@ [flpositive? C fl] [flround C fl] [flsin C fl] - [flsqrt S fl] + [flsqrt C fl] [fltan C fl] [fltruncate S fl] [flzero? C fl]