Version française
Home     About     Download     Resources     Contact us    
Browse thread
Behavior of %F
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Alain Frisch <alain.frisch@l...>
Subject: Behavior of %F
Hello,

The behavior of Printf w.r.t. %F changed recently.

Before (OCaml 3.10.0, and presumably 3.11.0):

# Printf.sprintf "%F" 1.;;
- : string = "1."


Now (OCaml 3.11.1+rc1):

# Printf.sprintf "%F" 1.;;
- : string = "1.000000"


This change comes from:

http://camlcvs.inria.fr/cgi-bin/cvsweb/ocaml/stdlib/printf.ml.diff?r1=1.58.2.1;r2=1.58.2.2;f=h


Is the new behavior intentional? The manual says:

========
F: convert a floating-point argument to Caml syntax (dddd.  or dddd.ddd 
or d.ddd e+-dd).
========

but it seems the new implementation never produces the form dddd.


-- Alain