Version française
Home     About     Download     Resources     Contact us    
Browse thread
Strange behaviour of string_of_float
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Olivier Andrieu <oandrieu@n...>
Subject: Re: [Caml-list] Strange behaviour of string_of_float
On Mon, Jun 23, 2008 at 10:45, David Allsopp <dra-news@metastack.com> wrote:
> All that said, the values given by
> string_of_float cannot always be fed back to float_of_string anyway (e.g.
> float_of_string (string_of_float nan))

euh, why do you say that ? it does :

  # float_of_string (string_of_float nan) ;;
  - : float = nan

float_of_string is basically strtod which should correctly handle nan and inf.

-- 
  Olivier