+ 3

0.1+0.2 = 0.3 ? what happen ?

i try 0.1 + 0.2 but answer is 0.30000000000000004

8th May 2017, 11:01 AM
Thiwanon Chomcharoen
Thiwanon Chomcharoen - avatar
5 Answers
+ 1
That's why you should use BigDecimal instead float or double when you work with currency.
8th May 2017, 11:08 AM
SzabĂł GĂĄbor
SzabĂł GĂĄbor - avatar
+ 1
The first tag is Java 😊
8th May 2017, 11:42 AM
SzabĂł GĂĄbor
SzabĂł GĂĄbor - avatar