Closed dansleboby closed 3 weeks ago
Hello,
Indeed there is a bug when the rounding is below 0.000001
which is what happens with 13.000001 - 13
as in you analyze returns 0.000000999999999
I'm making a fix which will convert microseconds from the string to integer (without stepping by float type) which should avoir this rounding issue: #3098
Hello,
I encountered an issue with the following code:
Carbon version: 3.8.0
PHP version: 8.1.3
I expected to get:
But I actually get:
I narrow down the error is comming from:
https://github.com/briannesbitt/Carbon/blob/master/src/Carbon/CarbonInterval.php#L521-L526
Because we are dealing with float and we do not round the result wird thing append due to how decimal and base 10 to base 2, see IEEE 754 and https://www.php.net/manual/en/language.types.float.php
Thanks!