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 PAA25529; Wed, 4 Jun 2003 15:12:41 +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 PAA25625 for ; Wed, 4 Jun 2003 15:12:40 +0200 (MET DST) Received: from mail0.epfl.ch (mail0.epfl.ch [128.178.50.57]) by concorde.inria.fr (8.11.1/8.11.1) with SMTP id h54DCdH04598 for ; Wed, 4 Jun 2003 15:12:39 +0200 (MET DST) Received: (qmail 19830 invoked from network); 4 Jun 2003 13:12:38 -0000 Received: from lamppc32.epfl.ch (HELO epfl.ch) (128.178.154.41) by mail0.epfl.ch with SMTP; 4 Jun 2003 13:12:38 -0000 Message-ID: <3EDDF046.9070300@epfl.ch> Date: Wed, 04 Jun 2003 15:12:38 +0200 From: Sebastien Briais User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3.1) Gecko/20030425 X-Accept-Language: en-us, en, fr-fr MIME-Version: 1.0 To: caml-list@inria.fr Subject: Re: [Caml-list] float numbers problem (CVS version of ocamlopt) References: <3EDC8CA0.9090209@epfl.ch> In-Reply-To: <3EDC8CA0.9090209@epfl.ch> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Spam: no; 0.00; caml-list:01 ocamlopt:01 inlining:01 bugged:01 toto:01 bash-:01 2.05:01 -inline:01 debugging:01 float:02 sebastien:03 experiments:04 let:04 nan:04 epfl:05 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Hello, concerning this problem, I have made some new experiments and I suspect the inlining to be bugged. I changed a bit my sample file to: -- start of toto.ml let square x = x *. x let _ = let x = 1.84066666666666823 in let x0 = 1.16666666666666674 in let dx = 0.674000000000001487 in let dx2 = 0.674000000000001487 *. 0.674000000000001487 in print_float (x -. x0); print_newline(); print_float (square (x -. x0)); print_newline(); print_float dx; print_newline(); print_float (square dx); print_newline(); print_float dx2; print_newline(); -- end of toto.ml bash-2.05b$ ocamlopt -o toto.opt toto.ml bash-2.05b$ ./toto.opt 0.674000000000001487 nan. 0.674000000000001487 nan. 0.454276000000002012 and now, without inlining: bash-2.05b$ ocamlopt -inline 0 -o toto.opt toto.ml bash-2.05b$ ./toto.opt 0.674000000000001487 0.454276000000002012 0.674000000000001487 0.454276000000002012 0.454276000000002012 it works !! hope that helps the debugging process Regards Sébastien ------------------- 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