dylan-smith / DiveIntelligence

1 stars 1 forks source link

Ceiling and floor are giving incorrect results #212

Closed dylan-smith closed 3 months ago

dylan-smith commented 3 months ago

Because we use Math.ceil() and Math.floor() in a bunch of places for conservatism (e.g. if the ceiling is 18.2m we want to show it as 19m).

However, due to floating point math this sometimes mean we are rounding up 18.0000000001. This can lead to confusing data shown for END and other calculations.