Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - Question: C language. Why is the final result less 1?
Question: C language. Why is the final result less 1?
Well, it's a question of accuracy ~ ~

Can be multiplied by decimals, for example: bns = bns20+(I-200000) * 0.05;

Then you should define bns and bns20 as floating-point numbers.

Printf is finally output ("bonus due is %d\n", BNS); It is also a floating-point number.

If the output is required to be %d, it is best to use floating point in the operation.

If it helps, give points.