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] string_of_float less accurate than sprintf "%f" ?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: David Chase <chase@w...>
Subject: Re: [Caml-list] string_of_float less accurate than sprintf "%f" ?
At 04:41 PM 5/3/2002 +0200, Oliver Bandel wrote:
>But a problem can occur too, when the type is not known
>from within the program: When writing the string-representation
>of a float to a file and read it back from the file,
>then the non-float representation of the float yields
>in parsing-/type-problems.
>So that is a problem within the program and it's data
>(I/O)... So this seems to be actually a problem.
>If (string_of_float 42.0) yields "42.0" (instead of "42"),
>this maybe is not the right value, because it maybe is only
>correct as "42.0000000000000"?

>Well.... philosophical question?

The "right" answer is to steal from Java, assuming that the
floating point data types are relativ

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