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 WAA31514; Mon, 21 Jul 2003 22:25:44 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id WAA04023 for ; Mon, 21 Jul 2003 22:25:42 +0200 (MET DST) Received: from woodstock.1969.ws (64-215-156-42.eosinc.net [64.215.156.42]) by nez-perce.inria.fr (8.11.1/8.11.1) with SMTP id h6LKPeT13341 for ; Mon, 21 Jul 2003 22:25:41 +0200 (MET DST) Received: (qmail 15408 invoked from network); 21 Jul 2003 20:00:58 -0000 Received: from karl.1969.ws (HELO 1969.ws) (10.3.2.15) by woodstock.1969.ws with SMTP; 21 Jul 2003 20:00:58 -0000 Message-ID: <3F1C4CB8.8000403@1969.ws> Date: Mon, 21 Jul 2003 13:27:36 -0700 From: Karl Zilles Organization: 1969 Communications, Inc. User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030529 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Jung Woon Ho CC: caml-list@inria.fr Subject: Re: [Caml-list] Passing a double from C to ocaml References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 passing:01 jung:99 conforming:01 mantissa:01 ocaml:01 float:02 wrote:03 data:03 exponent:04 equivalent:05 bits:05 uses:06 type:07 standard:07 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Jung Woon Ho wrote: > > Is there any way.. that I can pass a double from C to ocaml without > loosing precision? > What is the data type that is equivalent to double in Ocaml. > > I'm trying to get a double from a C-function and convert it to "Num" in > Ocaml. > > Thank you. > The OCaml "float" value is actually double precision. From the manual: Floating-point numbers Floating-point values are numbers in floating-point representation. The current implementation uses double-precision floating-point numbers conforming to the IEEE 754 standard, with 53 bits of mantissa and an exponent ranging from -1022 to 1023. ------------------- 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