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:[email protected]]
Sent: 01 December 2011 16:46
To: [email protected]
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





--
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 via email to