From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id pB21kMmH023001 for ; Fri, 2 Dec 2011 02:46:22 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AjICAGQs2E7Unw4TkGdsb2JhbABDhQSVa5AUIgEBAQEJCQ0HFAQhgXIBAQUIAhlLFwEDAgkOAwQBAQMCCRoDAgIZLAEJCAIEARILBQKHdwamIJFqgTCCPIYegRYEjGwomVU X-IronPort-AV: E=Sophos;i="4.71,281,1320620400"; d="scan'208";a="133609033" Received: from avasout04.plus.net ([212.159.14.19]) by mail1-smtp-roc.national.inria.fr with ESMTP; 02 Dec 2011 02:46:17 +0100 Received: from WinEight ([87.115.167.241]) by avasout04 with smtp id 41mF1i00A5Cppkv011mGDv; Fri, 02 Dec 2011 01:46:17 +0000 X-CM-Score: 0.00 X-CNFS-Analysis: v=2.0 cv=KctQQHkD c=1 sm=1 a=UB6T7elY/1jxK6oT6Cxw/A==:17 a=lFTX77YJdwAA:10 a=Xub9RBUEA-sA:10 a=IkcTkHD0fZMA:10 a=L8_KskJhAAAA:8 a=ZOzjf2MOAAAA:8 a=CjxXgO3LAAAA:8 a=rhm5JeElbB0su5JtAbwA:9 a=fBEAhnYKXow6XHOtlIEA:7 a=QEXdDO2ut3YA:10 a=DYcmdNZLyDkA:10 a=UB6T7elY/1jxK6oT6Cxw/A==:117 From: "Jon Harrop" To: "'Pierre Vittet'" , References: <4ED7AF40.2050101@pvittet.com> In-Reply-To: <4ED7AF40.2050101@pvittet.com> Date: Fri, 2 Dec 2011 01:46:03 -0000 Message-ID: <045001ccb094$27827050$768750f0$@ffconsultancy.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQC2DTrZERKFHXAhF850p/GMJ546AJf1Cuwg Content-Language: en-gb Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by walapai.inria.fr id pB21kMmH023001 Subject: RE: [Caml-list] float on 32 bits? You'll probably have to do a lot of work to get the same floating point behaviour from OCaml. Firstly, OCaml compiled with ocamlopt often retains 80 bits of precision when processing in registers. Secondly, the Java specification mandates more accurate handling of some functions, e.g. trigonometric functions. Note that floats are treated differently by code compiled with ocamlc and ocamlopt. Cheers, Jon. > -----Original Message----- > From: Pierre Vittet [mailto:piervit@pvittet.com] > Sent: 01 December 2011 16:46 > To: caml-list@inria.fr > Subject: [Caml-list] float on 32 bits? > > Hello! > > I am using ocaml to analyse java bytecode (http://javalib.gforge.inria.fr/). The > fact is that java has a float type which is coded on 32 bits and a double type > which is coded on 64 bits. I need to make corresponding types but ocaml only > has a float coded on 64 bits (IEE 754 norm, which java respect too), so I don"t > know how to get the float 32 bits. > > Is there some Float32 module? I cannot just place my float 32 into a float 64 > because I need to get same behaviour on basic operations. > > Thanks! > > Pierre Vittet > > -- > Caml-list mailing list. Subscription management and archives: > https://sympa-roc.inria.fr/wws/info/caml-list > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs