More precise types for: truncate, floor ceiling

This commit is contained in:
Sam Tobin-Hochstadt 2010-05-19 16:09:13 -05:00
parent fb042df0c7
commit 230f1a59c6
2 changed files with 16 additions and 4 deletions

View File

@ -790,7 +790,10 @@
[tc-e (let ()
(define: x : Any 7)
(if (box? x) (unbox x) (+ 1)))
Univ]
Univ]
[tc-e (floor 1/2) -Integer]
[tc-e (ceiling 1/2) -Integer]
[tc-e (truncate 0.5) -Flonum]
)
(test-suite
"check-type tests"

View File

@ -112,9 +112,18 @@
(-Real . -> . -ExactRational)
(N . -> . N))]
[floor (-> -Real -Real)]
[ceiling (-> -Real -Real)]
[truncate (-> -Real -Real)]
[floor (cl->*
(-> -ExactRational -Integer)
(-> -Flonum -Flonum)
(-> -Real -Real))]
[ceiling (cl->*
(-> -ExactRational -Integer)
(-> -Flonum -Flonum)
(-> -Real -Real))]
[truncate (cl->*
(-> -ExactRational -Integer)
(-> -Flonum -Flonum)
(-> -Real -Real))]
[make-rectangular (-Real -Real . -> . N)]
[make-polar (-Real -Real . -> . N)]
[real-part (N . -> . -Real)]