Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - When writing a C program, the integer 1 cannot be output with %f?
When writing a C program, the integer 1 cannot be output with %f?
Integer and floating-point data occupy different bytes.

For example, integer data takes up 4 bytes and floating-point data takes up 8 bytes.

If you output with %f, it is read according to 8 bytes of floating-point type, and the natural result will be different.

Sometimes the value is uncertain, sometimes it is 0 or 0.00000.