Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - Java operation suspects the mixed operation of integer and floating point.
Java operation suspects the mixed operation of integer and floating point.
This is because floating-point operations in java are not calculated by simple addition and subtraction operations.

Floating-point operations in java itself have always had such problems.

If you want accurate decimal calculation, it is recommended to use BigDecimal.

This is a better solution at present.