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
Re: [Caml-list] interfacing C with Ocaml (beginner questions)
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Damien Doligez <Damien.Doligez@i...>
Subject: Re: [Caml-list] interfacing C with Ocaml (beginner questions)
>From: francois bereux <>

>I found a Double_val macro, but no Val_double. What is the solution ?

You must use copy_double (which will do the allocation) because
floating-point values are boxed in O'Caml.

>value add(value x, value y)
>   CAMLparam2(x,y);
>   return Val_int(Int_val(x)+Int_val(y));

This is wrong.  You must use CAMLreturn.

-- Damien
Bug reports:  FAQ:
To unsubscribe, mail  Archives: