mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-02 21:10:27 +02:00
(angle): New tests.
This commit is contained in:
parent
48513dcdf2
commit
cfc9fc1c82
1 changed files with 14 additions and 0 deletions
|
@ -1989,6 +1989,20 @@
|
|||
;;; angle
|
||||
;;;
|
||||
|
||||
(with-test-prefix "angle"
|
||||
(define pi 3.14159265358979323846)
|
||||
(define (almost= x y)
|
||||
(> 0.01 (magnitude (- x y))))
|
||||
|
||||
(pass-if "inum +ve" (= 0 (angle 1)))
|
||||
(pass-if "inum -ve" (almost= pi (angle -1)))
|
||||
|
||||
(pass-if "bignum +ve" (= 0 (angle (1+ fixnum-max))))
|
||||
(pass-if "bignum -ve" (almost= pi (angle (1- fixnum-min))))
|
||||
|
||||
(pass-if "flonum +ve" (= 0 (angle 1.5)))
|
||||
(pass-if "flonum -ve" (almost= pi (angle -1.5))))
|
||||
|
||||
;;;
|
||||
;;; inexact->exact
|
||||
;;;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue