[0.17.8.0] IO Menu & Counter Floating Point Inprecision

While the bug guidelines warned against this, I’m including both in a single ticket because I believe the issues are deeply interconnected. This is a collection of two strange glitches presumably both caused by the use of floating point numbers in both the IO Menu and Counters. Due to this also being an inherently very useful feature, I propose you give counters some form of integer only mode as a workaround to both issues.

Essentially, after hitting the 24 bit (with similar effects increasingly to the 32 bit) integer limit on a counter, incrementing no longer works unless you do a higher power of two.

While trying to reproduce, I also found that the IO connection menu slider value and counter accuracy do not line up with each other.

Steps to Reproduce

  1. Place 1 Counter and 2 Buttons
  2. Max out the limits on the counter
  3. Assign one button to set the counter to 16,777,210 (setting instead to 16,777,215 rounds up) while the other button increments the counter by 1.
  4. Hit the set counter button, then the increment button until you hit 16,777,216 and it stops working.

What I expected to happen

I expected the I/O Menu to correctly set the value to 16,777,210 (sets it to 16,777,211) and the counter to increment to 16,777,217+.

What happened

The I/O Menu cannot store 16777210 (and other various numbers) and instead sets the value to 16777211.
The counter is stuck at 16777216 unless you add a number greater than one.

At the higher bounds of the glitch, any number under the next but above the currently broken power of two will round up.


Notes / Media

As for the all of the values and when they’re cut off,
1 - 16,777,216
2 - 33,554,432
4 - 67,108,864
8 - 134,217,728
16 - 268,435,456
32 - 536,870,912
64 - 1,073,741,824