Skip to content

Last value in FOR loops, using STEP and fractions, sometime results in unexpected valuesΒ #243

@jwa1974

Description

@jwa1974

Test Environment (required)

  • Platform: MEGA65, R6
  • ROM Release: 920417
  • Core Commit: aaf4542

Describe the bug
Using STEP with fractions in FOR loops can sometimes lead to unexpected results; e.g. the last value is completely off.

To Reproduce
Image

Expected behavior
The last value should be 10, not 0. (The same example in BASIC v2 will not print 10, but 9.70000002 since the fractions are handled differently, I guess.)

Screenshots
See screenshot above.

Additional context
This is a bit sneaky since doing the same loop, but up to 4 instead of 10, works as expected. I guess the inner workings are much like those of BASIC v2, but it is better "hidden" from the user. In that case, it might not be expected to have the last value of 10. (But it should not be 0 at least... πŸ˜‰)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions