diff options
| author | kleink <kleink@NetBSD.org> | 2001-12-02 20:12:03 +0000 |
|---|---|---|
| committer | kleink <kleink@NetBSD.org> | 2001-12-02 20:12:03 +0000 |
| commit | dcf4ce2588d281b763542cefebafc07b76743014 (patch) | |
| tree | bedc36cb83c98e819e2e8c3763bc5f70c390a8e0 /lib/libc/stdio/printf.3 | |
| parent | fbd78c8e3c19fb909fcb588ffc8e8d52e42bded6 (diff) | |
C99:
* Recognize %F.
* Convert {Infinity,NaN} to {"inf","nan"} for %[efg], and to
{"INF","NAN"} for %[EFG].
Diffstat (limited to 'lib/libc/stdio/printf.3')
| -rw-r--r-- | lib/libc/stdio/printf.3 | 67 |
1 files changed, 50 insertions, 17 deletions
diff --git a/lib/libc/stdio/printf.3 b/lib/libc/stdio/printf.3 index d5c945062cc..1c33586a316 100644 --- a/lib/libc/stdio/printf.3 +++ b/lib/libc/stdio/printf.3 @@ -1,4 +1,4 @@ -.\" $NetBSD: printf.3,v 1.21 2001/10/17 13:27:15 kleink Exp $ +.\" $NetBSD: printf.3,v 1.22 2001/12/02 20:12:03 kleink Exp $ .\" .\" Copyright (c) 1990, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -37,7 +37,7 @@ .\" .\" @(#)printf.3 8.1 (Berkeley) 6/4/93 .\" -.Dd April 30, 2001 +.Dd December 2, 2001 .Dt PRINTF 3 .Os .Sh NAME @@ -216,6 +216,7 @@ For .Cm e , .Cm E , .Cm f , +.Cm F , .Cm g , and .Cm G , @@ -267,6 +268,7 @@ produced by a signed conversion .Cm e , .Cm E , .Cm f , +.Cm F , .Cm g , .Cm G , or @@ -302,8 +304,9 @@ and conversions, the number of digits to appear after the decimal-point for .Cm e , .Cm E , +.Cm f , and -.Cm f +.Cm F conversions, the maximum number of significant digits for .Cm g and @@ -443,6 +446,7 @@ specifying that a following .Cm e , .Cm E , .Cm f , +.Cm F , .Cm g , or .Cm G @@ -505,6 +509,32 @@ or .Cm lu respectively. These conversion characters are deprecated, and will eventually disappear. +.It Cm fF +The +.Em double +argument is rounded and converted to decimal notation in the style +.Sm off +.Pf [-]ddd Cm \&. No ddd , +.Sm on +where the number of digits after the decimal-point character +is equal to the precision specification. +If the precision is missing, it is taken as 6; if the precision is +explicitly zero, no decimal-point character appears. +If a decimal point appears, at least one digit appears before it. +.Pp +If the double argument repesents an infinity it is converted +in the style +.Pf [-] Cm inf . +If the double argument represents a NaN it is converted +in the style +.Pf [-] Cm nan . +An +.Cm F +conversion produces +.Pf [-] Cm INF +and +.Pf [-] Cm NAN , +respectively. .It Cm eE The .Em double @@ -527,26 +557,23 @@ conversion uses the letter to introduce the exponent. The exponent always contains at least two digits; if the value is zero, the exponent is 00. -.It Cm f -The -.Em double -argument is rounded and converted to decimal notation in the style -.Sm off -.Pf [-]ddd Cm \&. No ddd , -.Sm on -where the number of digits after the decimal-point character -is equal to the precision specification. -If the precision is missing, it is taken as 6; if the precision is -explicitly zero, no decimal-point character appears. -If a decimal point appears, at least one digit appears before it. -.It Cm g +.Pp +Double arguments representing infinities or NaNs are converted in the +same styles as in the +.Cm f +and +.Cm F +conversions. +.It Cm gG The .Em double argument is converted in style .Cm f or .Cm e -(or +(or in style +.Cm F +or .Cm E for .Cm G @@ -560,6 +587,12 @@ is used if the exponent from its conversion is less than -4 or greater than or equal to the precision. Trailing zeros are removed from the fractional part of the result; a decimal point appears only if it is followed by at least one digit. +.Pp +Double arguments representing infinities or NaNs are converted in the +same styles as in the +.Cm f +and +.Cm F .It Cm c The .Em int |
