Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - Why should I multiply by 1 and then divide by 1 when I keep two digits in computer C language?
Why should I multiply by 1 and then divide by 1 when I keep two digits in computer C language?
the one above explained the number of digits. Enlarging by 1 times is to convert all three decimal places of the original number into the last three digits of the integer. Retaining two significant figures depends on three decimal places. 5 is added for rounding. For example, if the original number is 1.2345 1*1, it will be converted into a long integer->; 12342+5 divided by 1-> 1239/1--> 123 (See it clearly? 4 is left out, so if the third decimal place is greater than or equal to 5, plus 5 can carry it. In this way, 3 is rounded off and then converted into a double, and divided by 1, two significant figures are obtained.