caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Pierre Vittet <piervit@pvittet.com>
To: Jon Harrop <jon@ffconsultancy.com>,
	aplusbi@gmail.com, caml-list@inria.fr
Subject: Re: [Caml-list] float on 32 bits?
Date: Fri, 02 Dec 2011 15:07:22 +0100	[thread overview]
Message-ID: <4ED8DB9A.7010805@pvittet.com> (raw)
In-Reply-To: <045001ccb094$27827050$768750f0$@ffconsultancy.com>

Thanks for your answers (Jon and Niki).

I was not aware about that behaviour difference between ocamlc and 
ocamlopt...

Pierre

Le 02/12/2011 02:46, Jon Harrop a écrit :
> 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
>
>
>


      reply	other threads:[~2011-12-02 14:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-01 16:45 Pierre Vittet
2011-12-01 17:57 ` Niki Yoshiuchi
2011-12-02  1:46 ` Jon Harrop
2011-12-02 14:07   ` Pierre Vittet [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4ED8DB9A.7010805@pvittet.com \
    --to=piervit@pvittet.com \
    --cc=aplusbi@gmail.com \
    --cc=caml-list@inria.fr \
    --cc=jon@ffconsultancy.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).