Or in other words why the second call returns 5?
Math.ceil(5.0000000000000009)
6
Math.ceil(5.00000000000000009)
5
I'm guessing it has something to do the number of decimals getting bigger than 16 (the first call has 16 decimal digits and the second 17)
Why is this happening? Is there a workaround that works with big decimals?