Floating point math is fun. Here&#x27;s a post I did awhile back the deals with similar-ish shenanigans. <a href="https:&#x2F;&#x2F;medium.com&#x2F;forrest-the-woods&#x2F;perfect-prevention-of-int-overflows-f000f7e893ee" rel="nofollow">https:&#x2F;&#x2F;medium.com&#x2F;forrest-the-woods&#x2F;perfect-prevention-of-i...</a>