Version française
Home     About     Download     Resources     Contact us    
Browse thread
convertion between OCaml Big_int and C
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Olivier Schwander <olivier.schwander@c...>
Subject: Re: [Caml-list] convertion between OCaml Big_int and C
Le 13 Oct 2010 10:26, Jianzhou Zhao a écrit:
> I am not sure if this is a reasonable question. Does OCaml already
> have functions that do convertion between arbitrary-precision integers
> big_int in OCaml and any representation of large intergers in C? The
> implementation of big_int (otherlibs/num/big_int.*) uses nat
> (otherlibs/num/nat.*). Nat is a customized allocation (in C) as a list
> of native integers to represent arbitrary-precision. So converting
> big_int into C seems possible to me.

It seems you should have a look at the numerix library or at the OCaml
binding for GMP. I never used any of them so I cannot guaranty there are
really working (there are not a lot of references to them) but I think
they are more likely to be usable on both OCaml and C side.

Cheers,

Olivier