This question has already been answered:
There are integer and fractional. How to multiply them among themselves to get an accurate result. The variant with BigDecimal and Math.round () is not considered. Are there any other means for such calculations (without that.to pass the numbers to the constructor of the BigDecimal class. Without these dances with a tambourine)? Can the use of third-party libraries or other language tools? Here is an example: 24 * 0.05 = 1.2000000000000002 As we see the correct answer here is definitely 24 * 0.05 = 1.2. As in this case, get 1.2, not 1.20000000000002
24*0.05f? - Alexey Shimansky