(include "#.scm")

(check-eqv? (##fltruncate +inf.0) +inf.0)
(check-eqv? (##fltruncate -inf.0) -inf.0)
(check-eqv? (##fltruncate -0.0)     -0.0)
(check-eqv? (##fltruncate 0.0)       0.0)
(check-eqv? (##fltruncate 1.5)       1.0)
(check-eqv? (##fltruncate -1.5)     -1.0)
(check-eqv? (##fltruncate 2.12)      2.0)
(check-eqv? (##fltruncate -2.12)    -2.0)
(check-eqv? (##fltruncate 3.123)     3.0)
(check-eqv? (##fltruncate -3.123)   -3.0)

(check-eqv? (fltruncate +inf.0) +inf.0)
(check-eqv? (fltruncate -inf.0) -inf.0)
(check-eqv? (fltruncate -0.0)     -0.0)
(check-eqv? (fltruncate 0.0)       0.0)
(check-eqv? (fltruncate 1.5)       1.0)
(check-eqv? (fltruncate -1.5)     -1.0)
(check-eqv? (fltruncate 2.12)      2.0)
(check-eqv? (fltruncate -2.12)    -2.0)
(check-eqv? (fltruncate 3.123)     3.0)
(check-eqv? (fltruncate -3.123)   -3.0)

(check-tail-exn wrong-number-of-arguments-exception? (lambda () (fltruncate)))
(check-tail-exn wrong-number-of-arguments-exception? (lambda () (fltruncate 1.0 2.0)))

(check-tail-exn type-exception? (lambda () (fltruncate 1)))
(check-tail-exn type-exception? (lambda () (fltruncate 1/2)))
