这是indexloc提供的服务,不要输入任何密码
Skip to content

fix random types #1301

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 7, 2023
Merged

fix random types #1301

merged 2 commits into from
Feb 7, 2023

Conversation

gus-massa
Copy link
Contributor

The result of (random -20 -10) is a negative number. See also racket/racket#4562

I'm not sure that I'm using the correct types, because I never remember which is fixnum?, which one is exact-integer? and which one includes fake integers like 7.0.

The next line should be fixed too,

         (->opt -Int [-Pseudo-Random-Generator] -NonNegFixnum)

because the maximal number 4294967086 is not a fixnum in 32 bits.

I tried to add a test with negatives, but I get an error that I don't understand.

@capfredf capfredf merged commit 246173a into racket:master Feb 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants