0

I have a very specific case, when i do this sum in any calculator it throws the correct result:

2.0 + 1.7 + 0.85 + 0.35 = 4,9

But i try the same operation in php and get a strange result:

2.0 + 1.7 + 0.85 + 0.35 = 4.8999999999999995

The weird part is that if i remove the last number i get a "correct" result:

2.0 + 1.7 + 0.85 = 4,55

Can anybody help me get the correct result in every case

Jorge Risquez
  • 35
  • 1
  • 3

0 Answers0