Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - Why are there many zeros in floating-point numbers programmed by C language?
Why are there many zeros in floating-point numbers programmed by C language?
Float means floating point number, and there should be 7 decimal places when outputting. You should use the output control symbol to delete it. \x0d\ format string \ x0d \ [logo] [minimum output width] [. Precision] [length] Type \ x0d \ ""-MD ":If m is less than the actual output, it is left-aligned. \x0d\"%m.ns ":output m bits, take n bits of the string (from the left), and fill the left blank. When n >; When morm is omitted, m = n \x0d\ for example: "%7.2s" inputChina \ x0d \ output "ch" \ x0d \ "%m.nf": output floating-point number, where m is the width and n is the number to the right of decimal point \ x0d \ for example: "%3.65438".