Skip to content
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

pick random () to () integer(‐ish) output with scientific notation #160

Open
zamfofex opened this issue Feb 12, 2025 · 1 comment
Open
Labels
bug Something isn't working

Comments

@zamfofex
Copy link

The pick random () to () block detects whether it should output only integers by checking whether either of its inputs contains a dot, but it’s possible to input fractional numbers in a different way, i.e. with scientific notation.

E.g. if you enter 5e-1 in its first field (and leave the second field as 10, it will “attempt” to output only integers, but they will be offset by 0.5 (outputting e.g. 1.5, 6.5, 3.5, etc.)

The expected/intuitive behavior is that it should output an arbitrary float value in the range just as if 0.5 had been entered.

pick random (5e-1) to (10) outputting 3.5
pick random (5e-1) to (10) outputting 3.285...

@mxmou
Copy link

mxmou commented Feb 13, 2025

The expected/intuitive behavior is that it should output an arbitrary float value in the range just as if 0.5 had been entered.

This is also what Scratch 2.0 did:

Image

@cwillisf cwillisf added the bug Something isn't working label Feb 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants