Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - Delphi floating-point number problem
Delphi floating-point number problem
It compares the three numbers, quantity 1, quantity 2 and quantity 3, by rounding them respectively.

Qty 1 is rounded to 47.

Quantity 2 is rounded to 45.

Qty3 is rounded to 2.

So of course it's quantity 1

This is an internal algorithm.

If you don't want this. You can put qty2+qty3 together first, and then use them as floating-point numbers.