Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - In C language, both integer and real types can be accurately expressed as long as they are within the allowable range, right?
In C language, both integer and real types can be accurately expressed as long as they are within the allowable range, right?
This statement is wrong.

Integers can be expressed correctly.

But the real type is not necessarily.

Such as in programming.

If you want to take the last two decimal places

We usually use% .2f

To express

But the operation of the computer

He sometimes

Numbers after the third decimal point are rounded to the second decimal point.

For example, 1.3578

He will be 1.36.

But sometimes

He also shows 1.35.

therefore

The real type is within the allowable range.

Can't express it accurately.