* Added flexp
This commit is contained in:
parent
ad3f96d2ad
commit
3ecf53f9fd
BIN
bin/ikarus
BIN
bin/ikarus
Binary file not shown.
|
@ -11,6 +11,15 @@ ikrt_fl_round(ikp x, ikp y){
|
|||
return y;
|
||||
}
|
||||
|
||||
ikp
|
||||
ikrt_fl_exp(ikp x, ikp y){
|
||||
flonum_data(y) = exp(flonum_data(x));
|
||||
return y;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
ikp
|
||||
ikrt_bytevector_to_flonum(ikp x, ikpcb* pcb){
|
||||
double v = strtod((char*)x+off_bytevector_data, NULL);
|
||||
|
|
BIN
src/ikarus.boot
BIN
src/ikarus.boot
Binary file not shown.
|
@ -10,7 +10,7 @@
|
|||
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
|
||||
flfloor flceiling flnumerator fldenominator flexp
|
||||
flinteger? flonum-bytes flnan? flfinite? flinfinite?)
|
||||
(import
|
||||
(ikarus system $bytevectors)
|
||||
|
@ -20,7 +20,7 @@
|
|||
$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
|
||||
flfloor flceiling flnumerator fldenominator flexp
|
||||
flinteger? flonum-parts flonum-bytes flnan? flfinite? flinfinite?))
|
||||
|
||||
(define (flonum-bytes f)
|
||||
|
@ -273,6 +273,11 @@
|
|||
[else x]))]
|
||||
[else (error 'flceiling "~s is not a flonum" x)]))
|
||||
|
||||
(define (flexp x)
|
||||
(if (flonum? x)
|
||||
(foreign-call "ikrt_fl_exp" x ($make-flonum))
|
||||
(error 'flexp "~s is not a flonum" x)))
|
||||
|
||||
)
|
||||
|
||||
|
||||
|
|
|
@ -480,6 +480,7 @@
|
|||
[flceiling i rfl]
|
||||
[flnumerator i rfl]
|
||||
[fldenominator i rfl]
|
||||
[flexp i rfl]
|
||||
[fixnum->string i]
|
||||
[string->flonum i]
|
||||
[- i r]
|
||||
|
|
|
@ -315,12 +315,12 @@
|
|||
[flceiling C fl]
|
||||
[flcos C fl]
|
||||
[fldenominator C fl]
|
||||
[fldiv S fl]
|
||||
[fldiv-and-mod S fl]
|
||||
[fldiv0 S fl]
|
||||
[fldiv0-and-mod0 S fl]
|
||||
[fldiv D fl]
|
||||
[fldiv-and-mod D fl]
|
||||
[fldiv0 D fl]
|
||||
[fldiv0-and-mod0 D fl]
|
||||
[fleven? C fl]
|
||||
[flexp S fl]
|
||||
[flexp C fl]
|
||||
[flexpt S fl]
|
||||
[flfinite? C fl]
|
||||
[flfloor C fl]
|
||||
|
@ -329,8 +329,8 @@
|
|||
[fllog S fl]
|
||||
[flmax C fl]
|
||||
[flmin C fl]
|
||||
[flmod S fl]
|
||||
[flmod0 S fl]
|
||||
[flmod D fl]
|
||||
[flmod0 D fl]
|
||||
[flnan? C fl]
|
||||
[flnegative? C fl]
|
||||
[flnumerator C fl]
|
||||
|
|
Loading…
Reference in New Issue