From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id UAA07046; Fri, 3 May 2002 20:27:23 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id UAA07141 for ; Fri, 3 May 2002 20:27:22 +0200 (MET DST) Received: from TheWorld.com (pcls3.std.com [199.172.62.105]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g43IRLX28000 for ; Fri, 3 May 2002 20:27:21 +0200 (MET DST) Received: from watergate.world.std.com (pool-141-154-29-240.bos.east.verizon.net [141.154.29.240]) by TheWorld.com (8.9.3/8.9.3) with ESMTP id OAA08699 for ; Fri, 3 May 2002 14:27:20 -0400 Message-Id: <5.1.0.14.0.20020503142712.01dc7628@pop.theWorld.com> X-Sender: chase@pop.theWorld.com X-Mailer: QUALCOMM Windows Eudora Version 5.1 Date: Fri, 03 May 2002 14:28:24 -0400 To: caml-list@inria.fr From: David Chase Subject: Re: [Caml-list] string_of_float less accurate than sprintf "%f" ? In-Reply-To: References: <3CD134B0.8050100@ozemail.com.au> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk 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 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