[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#299784: marked as done (ocaml-doc: Mistake in Printf docs)



Your message dated Tue, 16 Jan 2007 23:32:22 +0100
with message-id <45AD5276.8030406@ens-lyon.org>
and subject line Bug#299784: ocaml-doc: Mistake in Printf docs
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--- Begin Message ---
Package: ocaml-doc
Version: 3.08.0-1
Severity: minor

Hi

the docs on printf seem to be wrong:

file:///usr/share/doc/ocaml/docs/ocaml.html/libref/Printf.html

# f: convert a floating-point argument to decimal notation, in the style dddd.ddd.
# F: convert a floating-point argument in Caml syntax (dddd.ddd with a mandatory .).
# e or E: convert a floating-point argument to decimal notation, in the style d.ddd e+-dd (mantissa and exponent).
# g or G: convert a floating-point argument to decimal notation, in style f or e, E (whichever is more compact).

But %f always prints dddd.ddd with a mandatory '.'. %F on the other
hand does not always print a '.', e.g. 1e+18 does not. %F seems to do
what %g describes.

MfG
	Goswin

-- System Information:
Debian Release: 3.1
Architecture: amd64 (x86_64)
Kernel: Linux 2.6.8-frosties-1
Locale: LANG=en_US, LC_CTYPE=en_US (charmap=ISO-8859-1)

-- no debconf information


--- End Message ---
--- Begin Message ---
Hi,

Georg Neis wrote:
> * Remi Vanicat <remi.vanicat@gmail.com> wrote:
>> On Wed, 16 Mar 2005 14:10:06 +0100, Goswin Brederlow
>> <brederlo@informatik.uni-tuebingen.de> wrote:
>>> # f: convert a floating-point argument to decimal notation, in the style dddd.ddd.
>>> # F: convert a floating-point argument in Caml syntax (dddd.ddd with a mandatory .).
>>> # e or E: convert a floating-point argument to decimal notation, in the style d.ddd e+-dd (mantissa and exponent).
>>> # g or G: convert a floating-point argument to decimal notation, in style f or e, E (whichever is more compact).
>>>
>>> But %f always prints dddd.ddd with a mandatory '.'. %F on the other
>>> hand does not always print a '.', e.g. 1e+18 does not. %F seems to do
>>> what %g describes.
>> %f does as the doc say:
>> # Printf.printf "%.0f\n" 10.;;
>> 10
>> But by default there is alway 6 digit after the dot (and then a dot).
>> Compare to:
>> # Printf.printf "%.0F\n" 10.;;
>> 10.
>>
>> the documentation for %F is partially misleading, it alway convert a
>> floating-point argument in Caml syntax, but in the 1e+18 case the dot
>> is not mandatory in the ocaml syntax, I will forward it.
> 
> The current documentation says:
>   f: convert a floating-point argument to decimal notation, in the style
>      dddd.ddd.
>   F: convert a floating-point argument to Caml syntax (dddd. or dddd.ddd
>      or d.ddd e+-dd).
>   e or E: convert a floating-point argument to decimal notation, in the
>      style d.ddd e+-dd (mantissa and exponent).
>   g or G: convert a floating-point argument to decimal notation, in
>      style f or e, E (whichever is more compact).
> 
> So, can this bug be closed?

Yes, thanks!

Cheers,

Samuel.

--- End Message ---

Reply to: