Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] float pretty-printing precision, once more.
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2002-12-10 (15:37)
From: Jacques Carette <carette@m...>
Subject: RE: [Caml-list] float pretty-printing precision, once more.
Damien Doligez wrote:

> In the current working version (3.06+18), the precision used by
> string_of_float has been increased to 17 digits.  I *think* this
> is enough to represent all the double-precision floating-point
> numbers:

Almost...  there are a few (rare) cases where 18 Digits are needed!  But 18
is indeed the 'right' number, assuming the system does proper IEEE rounding.
I am not an expert on this, but I used to have one as an employee (back when
I was manager of the Mathematics Group at Maple), and I learned this from

> I don't know if we will keep this change for the next release
> of O'Caml.

Correctness and ease-of-use do clash badly when it comes to FP.  I prefer
correctness, because latter syntactic sugar can deal with the ease-of-use
problem, but the other way around does not work at all.

Jacques C.

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: