Skip to content

Commit 01ab35a

Browse files
committed
PR#7507: updated description for printf "%g"
Align the description of the printf conversion specification "%g" with the ISO C90 description by mentioning the removal of trailing zeros and decimal-point character.
1 parent e789651 commit 01ab35a

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

Changes

+4
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,10 @@ Working version
8787
- PR#7254, GPR#1096: Rudimentary documentation of ocamlnat
8888
(Mark Shinwell)
8989

90+
- PR#7507: Align the description of the printf conversion
91+
specification "%g" with the ISO C90 description.
92+
(Florian Angeletti)
93+
9094
### Tools:
9195

9296
- GPR#1045: ocamldep, add a "-shared" option to generate dependencies

stdlib/printf.mli

+4-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,10 @@ val fprintf : out_channel -> ('a, out_channel, unit) format -> 'a
5656
- [e] or [E]: convert a floating-point argument to decimal notation,
5757
in the style [d.ddd e+-dd] (mantissa and exponent).
5858
- [g] or [G]: convert a floating-point argument to decimal notation,
59-
in style [f] or [e], [E] (whichever is more compact).
59+
in style [f] or [e], [E] (whichever is more compact). Moreover,
60+
any trailing zeros are removed from the fractional part of the result
61+
and the decimal-point character is removed if there is no fractional
62+
part remaining.
6063
- [h] or [H]: convert a floating-point argument to hexadecimal notation,
6164
in the style [0xh.hhhh e+-dd] (hexadecimal mantissa, exponent in
6265
decimal and denotes a power of 2).

0 commit comments

Comments
 (0)