Fixed contracts on exact-round, etc.
This commit is contained in:
parent
f9ec37bbdd
commit
b7fea6be5a
|
@ -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)
|
||||
|
|
|
@ -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))].
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user