Skip to content

Commit c3d245b

Browse files
authored
fix a bug in the specification for types of quotient &/ remainder (#1049)
The bug was brought to you by http://drdr.racket-lang.org/56628/racket/share/pkgs/typed-racket-test/tr-random-testing.rkt
1 parent f5fca70 commit c3d245b

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

typed-racket-lib/typed-racket/base-env/base-env-numeric.rkt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -694,7 +694,7 @@
694694
(define-values (quotient-spec remainder-spec quotient/remainder-spec)
695695
(quotient-reminder-cases
696696
(list -Zero -Int (list -Zero -Zero))
697-
(list -One -One (list -Zero -One))
697+
(list -One -One (list -One -Zero))
698698
;; division by one is identity, and has no remainder
699699
(list -PosByte -One (list -PosByte -Zero))
700700
(list -Byte -One (list -Byte -Zero))

typed-racket-test/unit-tests/typecheck-tests.rkt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1136,6 +1136,10 @@
11361136
(+ a b a* b*))
11371137
-Nat]
11381138

1139+
[tc-e (sinh (let-values (((x y) (quotient/remainder (exact-round 1) (sqr (exact-round 1)))))
1140+
y))
1141+
-Zero]
1142+
11391143
[tc-e (raise-type-error 'foo "bar" 5) (t:Un)]
11401144
[tc-e (raise-type-error 'foo "bar" 7 (list 5)) (t:Un)]
11411145

0 commit comments

Comments
 (0)