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 TAA20657; Sun, 27 Apr 2003 19:13:38 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: (from xleroy@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id TAA20701 for caml-list@pauillac.inria.fr; Sun, 27 Apr 2003 19:13:36 +0200 (MET DST) 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 SAA19418 for ; Sun, 27 Apr 2003 18:25:51 +0200 (MET DST) Received: from abel (nat.umh.ac.be [193.190.193.1]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id h3RGPoH28108 for ; Sun, 27 Apr 2003 18:25:51 +0200 (MET DST) Received: from abel ([127.0.0.1] helo=localhost ident=trch) by abel with esmtp (Exim 3.36 #1 (Debian)) id 199p64-0000zm-00; Sun, 27 Apr 2003 18:33:48 +0200 Date: Sun, 27 Apr 2003 18:33:47 +0200 (CEST) Message-Id: <20030427.183347.106461378.debian00@tiscali.be> To: siegfried.gonzi@stud.uni-graz.at Cc: brian.hurt@qlogic.com, caml-list@inria.fr Subject: [Caml-list] Re: IEEE-754 (was: Easy solution in OCaml?) From: Christophe TROESTLER In-Reply-To: References: <3EAA8D78.8000006@stud.uni-graz.at> Organization: None X-Spook: AIEWS csim hackers AK-47 colonel BATF LLNL cracking PGP BRLO X-Mailer-URL: http://www.mew.org/ X-Operating-System: GNU/Linux (http://www.linux.org/) X-Blessing: Om Ah Hum Vajra Guru Pema Siddhi Hum X-Mailer: Mew version 3.2 on Emacs 21.2 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; troestler:01 tiscali:99 qlogic:01 siegfried:01 gonzi:01 vectors:01 0.0:01 wishlist:01 chris:01 bool:01 christophe:01 ocaml:01 arithmetic:01 float:02 wrote:03 X-Spam: no; 0.00; troestler:01 tiscali:99 qlogic:01 siegfried:01 gonzi:01 vectors:01 0.0:01 wishlist:01 chris:01 bool:01 christophe:01 ocaml:01 arithmetic:01 float:02 wrote:03 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Sat, 26 Apr 2003, Brian Hurt wrote: > > On Sat, 26 Apr 2003, Siegfried Gonzi wrote: > > > dividing the two vectors: > > (vector 0.0 0.0 23.34 23.4) through (vector 0.0 0.0 0.0 23.4) > > > > (vector #f #f #f 1.0) > > Hmm? What platform are you on? Linux on x86: > > # let x = [ 0.0 ; 1.0 ; 0.0 ; 1.0 ] > and y = [ 0.0 ; 0.0 ; 1.0 ; 1.0 ] ;; List.map2 ( /. ) x y > - : float list = [nan.; inf.; 0.; 1.] This is a feature of IEEE-754 arithmetic which means it should work this way on virtually all architectures. BTW, may I take this opportunity to advertise my little wishlist in this respect ? I'd like to have: FAST is_nan : float -> bool is_finite : float -> bool (I know it is possible to define them with classify_float but is is not fast) and copysign : float -> float -> float Cheers, ChriS ------------------- 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