printf() Default Floating-Point Precision Is 6 Decimals (29557)
The information in this article applies to:
- The C Run-Time (CRT), when used with:
- Microsoft C for MS-DOS 5.1
- Microsoft C for MS-DOS 6.0
- Microsoft C for MS-DOS 6.0a
- Microsoft C for MS-DOS 6.0ax
- Microsoft C for OS/2 6.0a
- Microsoft C/C++ for MS-DOS 7.0
- Microsoft Visual C++, 32-bit Learning Edition 4.0
- Microsoft Visual C++, 32-bit Professional Edition 2.0
- Microsoft Visual C++, 32-bit Professional Edition 4.0
This article was previously published under Q29557 SUMMARY
By default, the printf() function displays a floating-point number to
six digits of precision. This default also holds for double precision
numbers.
To display additional digits of precision, specify a value for the
precision field in the printf() format specification, as follows:
%[<flags>][<width>][.<precision>]<type>
Modification Type: | Major | Last Reviewed: | 12/11/2003 |
---|
Keywords: | kbCRT KB29557 |
---|
|