Added fixnum->flonum
This commit is contained in:
parent
46193467c5
commit
6ff9e3dc9c
BIN
src/ikarus.boot
BIN
src/ikarus.boot
Binary file not shown.
|
@ -8,12 +8,13 @@
|
|||
(library (ikarus flonums)
|
||||
(export $flonum->exact $flonum-signed-biased-exponent flonum-parts
|
||||
inexact->exact exact $flonum-rational? $flonum-integer? $flzero?
|
||||
$flnegative? flpositive? flabs)
|
||||
$flnegative? flpositive? flabs fixnum->flonum)
|
||||
(import
|
||||
(ikarus system $bytevectors)
|
||||
(except (ikarus system $flonums) $flonum-signed-biased-exponent
|
||||
$flonum-rational? $flonum-integer?)
|
||||
(except (ikarus) inexact->exact exact flpositive? flabs))
|
||||
(except (ikarus) inexact->exact exact flpositive? flabs
|
||||
fixnum->flonum))
|
||||
|
||||
(define (flonum-bytes f)
|
||||
(unless (flonum? f)
|
||||
|
@ -130,6 +131,12 @@
|
|||
($fl* x -1.0)
|
||||
x)
|
||||
(error 'flabs "~s is not a flonum" x)))
|
||||
|
||||
(define (fixnum->flonum x)
|
||||
(if (fixnum? x)
|
||||
($fixnum->flonum x)
|
||||
(error 'fixnum->flonum "~s is not a fixnum")))
|
||||
|
||||
)
|
||||
|
||||
|
||||
|
|
|
@ -492,6 +492,7 @@
|
|||
[exact-integer-sqrt i r]
|
||||
[exact->inexact i r]
|
||||
[inexact->exact i r]
|
||||
[fixnum->flonum i r]
|
||||
[exact i r]
|
||||
[inexact i r]
|
||||
[random i]
|
||||
|
|
|
@ -298,7 +298,7 @@
|
|||
[fxxor D fx]
|
||||
[fxzero? D fx]
|
||||
;;;
|
||||
[fixnum->flonum S fl]
|
||||
[fixnum->flonum C fl]
|
||||
[fl* C fl]
|
||||
[fl+ C fl]
|
||||
[fl- C fl]
|
||||
|
|
Loading…
Reference in New Issue