Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] Passing a double from C to ocaml
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Karl Zilles <zilles@1...>
Subject: Re: [Caml-list] Passing a double from C to ocaml
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 Archives:
Bug reports: FAQ:
Beginner's list: