* Added flsin, flcos, fltan, flasin, flacos, flatan procedures.

This commit is contained in:
Abdulaziz Ghuloum 2007-09-02 21:16:54 -04:00
parent 6ff9e3dc9c
commit 89786ff4d0
4 changed files with 44 additions and 8 deletions

Binary file not shown.

View File

@ -8,13 +8,14 @@
(library (ikarus flonums)
(export $flonum->exact $flonum-signed-biased-exponent flonum-parts
inexact->exact exact $flonum-rational? $flonum-integer? $flzero?
$flnegative? flpositive? flabs fixnum->flonum)
$flnegative? flpositive? flabs fixnum->flonum
flsin flcos fltan flasin flacos flatan)
(import
(ikarus system $bytevectors)
(except (ikarus system $flonums) $flonum-signed-biased-exponent
$flonum-rational? $flonum-integer?)
(except (ikarus) inexact->exact exact flpositive? flabs
fixnum->flonum))
fixnum->flonum flsin flcos fltan flasin flacos flatan))
(define (flonum-bytes f)
(unless (flonum? f)
@ -137,6 +138,35 @@
($fixnum->flonum x)
(error 'fixnum->flonum "~s is not a fixnum")))
(define (flsin x)
(if (flonum? x)
(foreign-call "ikrt_fl_sin" x)
(error 'flsin "~s is not a flonum" x)))
(define (flcos x)
(if (flonum? x)
(foreign-call "ikrt_fl_cos" x)
(error 'flcos "~s is not a flonum" x)))
(define (fltan x)
(if (flonum? x)
(foreign-call "ikrt_fl_tan" x)
(error 'fltan "~s is not a flonum" x)))
(define (flasin x)
(if (flonum? x)
(foreign-call "ikrt_fl_asin" x)
(error 'flasin "~s is not a flonum" x)))
(define (flacos x)
(if (flonum? x)
(foreign-call "ikrt_fl_acos" x)
(error 'flacos "~s is not a flonum" x)))
(define (flatan x)
(if (flonum? x)
(foreign-call "ikrt_fl_atan" x)
(error 'flatan "~s is not a flonum" x)))
)

View File

@ -438,6 +438,12 @@
[flabs i rfl]
[flmax i rfl]
[flround i rfl]
[flsin i rfl]
[flcos i rfl]
[fltan i rfl]
[flasin i rfl]
[flacos i rfl]
[flatan i rfl]
[fixnum->string i]
[string->flonum i]
[- i r]

View File

@ -309,11 +309,11 @@
[fl>=? C fl]
[fl>? C fl]
[flabs C fl]
[flacos S fl]
[flasin S fl]
[flatan S fl]
[flacos C fl]
[flasin C fl]
[flatan C fl]
[flceiling S fl]
[flcos S fl]
[flcos C fl]
[fldenominator S fl]
[fldiv S fl]
[fldiv-and-mod S fl]
@ -338,9 +338,9 @@
[flonum? S fl]
[flpositive? S fl]
[flround C fl]
[flsin S fl]
[flsin C fl]
[flsqrt S fl]
[fltan S fl]
[fltan C fl]
[fltruncate S fl]
[flzero? C fl]
[real->flonum D fl]