Files
Bubberstation/code/modules/client
SkyratBot 6b348e28d2 [MIRROR] Fixes floating point inaccuracies in numeric preferences [MDB IGNORE] (#20229)
* Fixes floating point inaccuracies in numeric preferences (#74384)

## About The Pull Request

Floating point inaccuracy fun.

Since it's possible to have a `minimum`,`maximum`, and `step` that are
floats we need to round everything to `step` to ensure the comparison
operations work.

If we do not do this, there is no guarantee that `if(min <= number &&
number <= max)` will work correctly.

For example, in the linked issues, this manifested as the minimum value
(0.8) being considered invalid when the input was also 0.8.

Fixes https://github.com/Skyrat-SS13/Skyrat-tg/issues/9507
Fixes https://github.com/Skyrat-SS13/Skyrat-tg/issues/14394

## Why It's Good For The Game

Fixes an obscure bug that has gone unnoticed for a couple years.

## Changelog

🆑
fix: fixes floating point inaccuracies in numeric prefs
/🆑

* Fixes floating point inaccuracies in numeric preferences

---------

Co-authored-by: Bloop <vinylspiders@gmail.com>
2023-04-01 03:25:41 +01:00
..