Fixed contracts on exact-round, etc.

This commit is contained in:
Neil Toronto 2012-06-06 16:16:52 -06:00
parent f9ec37bbdd
commit b7fea6be5a
2 changed files with 5 additions and 5 deletions

View File

@ -95,7 +95,7 @@
;; inexact->exact composed with round, floor, ceiling, truncate
(define-syntax-rule (define-integer-conversion name convert)
(define (name x)
(unless (real? x) (raise-argument-error 'name "real?" x))
(unless (rational? x) (raise-argument-error 'name "rational?" x))
(inexact->exact (convert x))))
(define-integer-conversion exact-round round)

View File

@ -1072,22 +1072,22 @@ Returns the hyperbolic cosine of @racket[z].}
Returns the hyperbolic tangent of @racket[z].}
@defproc[(exact-round [x real?]) real?]{
@defproc[(exact-round [x rational?]) exact-integer?]{
Equivalent to @racket[(inexact->exact (round x))].
}
@defproc[(exact-floor [x real?]) real?]{
@defproc[(exact-floor [x rational?]) exact-integer?]{
Equivalent to @racket[(inexact->exact (floor x))].
}
@defproc[(exact-ceiling [x real?]) real?]{
@defproc[(exact-ceiling [x rational?]) exact-integer?]{
Equivalent to @racket[(inexact->exact (ceiling x))].
}
@defproc[(exact-truncate [x real?]) real?]{
@defproc[(exact-truncate [x rational?]) exact-integer?]{
Equivalent to @racket[(inexact->exact (truncate x))].
}