scratchfoundation / scratchfoundation/scratch-editor
`pick random () to ()` integer(‐ish) output with scientific notation
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 281
- Forks
- 276
- Avg merge
- 7d 8h
- Merged PRs (30d)
- 6
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the implementation of the pick random () to () block and reproduce the issue with 5e-1 and 10. Done means scientific-notation fractional input produces arbitrary float values in the range, matching the behavior of an equivalent decimal input.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100