Added asin, acos, and tan

This commit is contained in:
Abdulaziz Ghuloum 2007-09-02 20:57:02 -04:00
parent 38a60b4d84
commit 46193467c5
4 changed files with 30 additions and 6 deletions

Binary file not shown.

View File

@ -142,7 +142,7 @@
abs
exact->inexact inexact floor ceiling round log fl=? fl<? fl<=? fl>?
fl>=? fl+ fl- fl* fl/ flsqrt flmin flzero? flnegative?
sin cos atan sqrt
sin cos tan asin acos atan sqrt
flround flmax random)
(import
(ikarus system $fx)
@ -160,7 +160,7 @@
exact-integer-sqrt min max abs
fl=? fl<? fl<=? fl>? fl>=? fl+ fl- fl* fl/ flsqrt flmin
flzero? flnegative?
sin cos atan sqrt
sin cos tan asin acos atan sqrt
flround flmax random))
; (foreign-call "ikrt_fixnum_to_flonum" x))
@ -1550,6 +1550,27 @@
[(fixnum? x) (foreign-call "ikrt_fx_cos" x)]
[else (error 'cos "unsupported ~s" x)])))
(define tan
(lambda (x)
(cond
[(flonum? x) (foreign-call "ikrt_fl_tan" x)]
[(fixnum? x) (foreign-call "ikrt_fx_tan" x)]
[else (error 'tan "unsupported ~s" x)])))
(define asin
(lambda (x)
(cond
[(flonum? x) (foreign-call "ikrt_fl_asin" x)]
[(fixnum? x) (foreign-call "ikrt_fx_asin" x)]
[else (error 'asin "unsupported ~s" x)])))
(define acos
(lambda (x)
(cond
[(flonum? x) (foreign-call "ikrt_fl_acos" x)]
[(fixnum? x) (foreign-call "ikrt_fx_acos" x)]
[else (error 'acos "unsupported ~s" x)])))
(define atan
(lambda (x)
(cond

View File

@ -455,8 +455,11 @@
[expt i r]
[sin i r]
[cos i r]
[sqrt i r]
[tan i r]
[asin i r]
[acos i r]
[atan i r]
[sqrt i r]
[number? i r]
[bignum? i]
[ratnum? i]

View File

@ -79,11 +79,11 @@
[* C ba se]
[/ C ba se]
[abs C ba se]
[acos S ba se]
[acos C ba se]
[angle D ba se]
[append C ba se]
[apply C ba se]
[asin S ba se]
[asin C ba se]
[assert C ba]
[assertion-violation S ba]
[atan C ba se]
@ -219,7 +219,7 @@
[symbol->string C ba se]
[symbol=? C ba]
[symbol? C ba se]
[tan S ba se]
[tan C ba se]
[truncate S ba se]
[values C ba se]
[vector C ba se]