Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - The division of two ints is equal to a float.
The division of two ints is equal to a float.
The method on the first floor is right. As long as one of numerator and denominator is upgraded to float type, the compilation system will be upgraded to the highest float type before running.

The second layer is incorrect, because the result of shaping operation is converted into floating point type, and the shaping obtained by dividing the two shaping operations will still lose its accuracy if it is converted into floating point type.