In 186B - Growing Mushrooms, Why does a solution with float 119775360 fails while a solution with double 119774888 passes- when we need only 2 digits after the decimal points?

The solution with float fails on 10th testcase where it gives - wrong answer 2nd words differ - expected: '867788.40', found: '867788.38'

Isn’t double useful only when we need a lot of digits after the decimal point?
Thanks in Advance.

i don’t think using round() would be a great idea as the solution passes with double and not with float meaning we need to be more accurate

what is probably happening here is before getting to the ans in the other operations float gives more accurate ans which prbly resulted in the 0.02 diff

double has 15 decimal digits of precision.
and float has 7 decimal digits of precision.

so though you are using fixed and precision(2) for the output value, for float its getting rounded of till 7 digits only whereas for double its checking till 15 digits.
Hope it helps