Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] failwith, raise and type inference
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Greg Bacon <gbacon@b...>
Subject: Re: [Caml-list] weird floating poing behavior on windows
In message <008101c418ea$3ff43780$6401a8c0@xp>,
    "Zeno Lee" writes:

: Can anyone tell me what's going on here?  Is this a known issue on
: windows? 
: 
: C:\>ocaml
:         Objective Caml version 3.07+2
: # 0.2 *. 0.26;;
: - : float = 0.052000000000000005
: # 0.8 *. 0.7 *. 0.8;;
: - : float = 0.44799999999999995

It's a known issue on digital computers, i.e., with finite-precision
arithmetic.  See "What Every Computer Scientist Should Know About
Floating-Point Arithmetic":

    http://www.validlab.com/goldberg/paper.pdf

Greg

-------------------
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