Skip to contentSkip to conversation

printf.3: Add detail on the first digit with the %e format

PATCH In review Vincent Lefevre 2 participants 2 messages Aug 20, 2019 – Sep 13, 2019 Man-pages: manual pages for Linux -- Sections 2, 3, 4, 5, and 7

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 printf.3: Add detail on the first digit with the %e format

This requirement on the first digit with the %e format comes from the ISO C standard. It ensures that all the digits in the output are significant and forbids output with a precision less than requested.

---
 man3/printf.3 | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
man3/printf.3 +2 -1
index fb40b7077..66ad6af02 100644
@@ -658,7 +658,8 @@ The
 .I double
 argument is rounded and converted in the style
 .RB [\-]d \&. ddd e \(+-dd
-where there is one digit before the decimal-point character and the number
+where there is one digit (which is nonzero if the argument is nonzero)
+before the decimal-point character and the number
 of digits after it is equal to the precision; if the precision is missing,
 it is taken as 6; if the precision is zero, no decimal-point character
 appears.
Signature · 1 line
2.23.0.rc1
#1 lore raw

Hello Vincent,

Quoted 3 lines · Vincent Lefevre

This requirement on the first digit with the %e format comes from the ISO C standard. It ensures that all the digits in the output are significant and forbids output with a precision less than requested.

Thanks. Patch applied.

Cheers,

Michael

Quoted 20 lines
---
 man3/printf.3 | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
man3/printf.3 +2 -1
index fb40b7077..66ad6af02 100644
@@ -658,7 +658,8 @@ The
 .I double
 argument is rounded and converted in the style
 .RB [\-]d \&. ddd e \(+-dd
-where there is one digit before the decimal-point character and the number
+where there is one digit (which is nonzero if the argument is nonzero)
+before the decimal-point character and the number
 of digits after it is equal to the precision; if the precision is missing,
 it is taken as 6; if the precision is zero, no decimal-point character
 appears.
Signature · 3 lines
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/