Version française
Home     About     Download     Resources     Contact us    
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: John Max Skaller <skaller@o...>
Subject: Re: [Caml-list] string_of_float less accurate than sprintf "%f" ?
Beck01, Wolfgang wrote:

>Hello,
>
>while doing some time measurements with Unix.gettimeofday() I
>discovered a problem with string_of_float:
>
># string_of_float 123456789.123456789;;
>- : string = "123456789.123"
>
There's another problem too:

# string_of_float 42.0;;
- : string = "42"

The result isn't an ocaml float literal.

-- 
John Max Skaller, mailto:skaller@ozemail.com.au
snail:10/1 Toxteth Rd, Glebe, NSW 2037, Australia.
voice:61-2-9660-0850




-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners