mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-01 12:20:26 +02:00
(truncate, round, asinh, acosh, atanh): Add some tests.
This commit is contained in:
parent
9af31eed61
commit
14a6784cf1
1 changed files with 43 additions and 0 deletions
|
@ -1863,10 +1863,32 @@
|
|||
;;; truncate
|
||||
;;;
|
||||
|
||||
(with-test-prefix "truncate"
|
||||
(pass-if (= 1 (truncate 1.75)))
|
||||
(pass-if (= 1 (truncate 1.5)))
|
||||
(pass-if (= 1 (truncate 1.25)))
|
||||
(pass-if (= 0 (truncate 0.75)))
|
||||
(pass-if (= 0 (truncate 0.5)))
|
||||
(pass-if (= 0 (truncate 0.0)))
|
||||
(pass-if (= 0 (truncate -0.5)))
|
||||
(pass-if (= -1 (truncate -1.25)))
|
||||
(pass-if (= -1 (truncate -1.5))))
|
||||
|
||||
;;;
|
||||
;;; round
|
||||
;;;
|
||||
|
||||
(with-test-prefix "round"
|
||||
(pass-if (= 2 (round 1.75)))
|
||||
(pass-if (= 2 (round 1.5)))
|
||||
(pass-if (= 1 (round 1.25)))
|
||||
(pass-if (= 1 (round 0.75)))
|
||||
(pass-if (= 0 (round 0.5)))
|
||||
(pass-if (= 0 (round 0.0)))
|
||||
(pass-if (= 0 (round -0.5)))
|
||||
(pass-if (= -1 (round -1.25)))
|
||||
(pass-if (= -2 (round -1.5))))
|
||||
|
||||
;;;
|
||||
;;; exact->inexact
|
||||
;;;
|
||||
|
@ -1889,6 +1911,27 @@
|
|||
(pass-if "(= 1 (expt 0.0 0))" (= 1 (expt 0.0 0)))
|
||||
(pass-if "(= 1 (expt 0.0 0.0))" (= 1 (expt 0.0 0.0))))
|
||||
|
||||
;;;
|
||||
;;; asinh
|
||||
;;;
|
||||
|
||||
(with-test-prefix "asinh"
|
||||
(pass-if (= 0 (asinh 0))))
|
||||
|
||||
;;;
|
||||
;;; acosh
|
||||
;;;
|
||||
|
||||
(with-test-prefix "acosh"
|
||||
(pass-if (= 0 (acosh 1))))
|
||||
|
||||
;;;
|
||||
;;; atanh
|
||||
;;;
|
||||
|
||||
(with-test-prefix "atanh"
|
||||
(pass-if (= 0 (atanh 0))))
|
||||
|
||||
;;;
|
||||
;;; make-rectangular
|
||||
;;;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue