From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id 468E8BBAF for ; Wed, 13 Oct 2010 18:01:51 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AkACACN0tUxKfVIuimdsb2JhbACTKAaOGQgVAQEBCgkMBw8FH6F9i2KGdSOIYQEBAwWFQwSKQYR/hBM X-IronPort-AV: E=Sophos;i="4.57,326,1283724000"; d="scan'208";a="73454466" Received: from mail-ww0-f46.google.com ([74.125.82.46]) by mail4-smtp-sop.national.inria.fr with ESMTP; 13 Oct 2010 18:01:50 +0200 Received: by wwb17 with SMTP id 17so1021858wwb.3 for ; Wed, 13 Oct 2010 09:01:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=fH3pGSDLWtIC+DZs42nw8EoIJlQfVlJBPt3aWs3AfO8=; b=rqpePBEvWEiLqb1aNtO1PL6P1fnf+xUhTg39nAxg0/596DQOZ352wM+E6x4Q2WT7iJ lbRKXSD2hiyPg8davn1Naz5AZQUzzp5vWuGkl6xQlf6zregRpnF+oRUS74O7SyTgGxuc 1mKUmflmR7JPTutuKjmd3AOQGCscx/O5/Pu6s= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=yISzNn6C8rbQWAPceZTNz/xutpvhx+JnoW6NNEx6SXhCwNwTuXGKO0VZi9RURc941p IhT6SHzTGVt9FkBnpr+7gcHflXncZePYHlVTXULrV3Qm9bcgz332WyKP9s1XV9yTm+zC zW5Qfgb+B2hNrFDFke52EiJbzjaaUXj1GM/6I= MIME-Version: 1.0 Received: by 10.216.46.15 with SMTP id q15mr8500566web.103.1286985709528; Wed, 13 Oct 2010 09:01:49 -0700 (PDT) Sender: jianzhou.zh@gmail.com Received: by 10.216.229.193 with HTTP; Wed, 13 Oct 2010 09:01:49 -0700 (PDT) In-Reply-To: <20101013144829.GB28174@pomerol.lix.polytechnique.fr> References: <20101013144829.GB28174@pomerol.lix.polytechnique.fr> Date: Wed, 13 Oct 2010 12:01:49 -0400 X-Google-Sender-Auth: DpQneA9LPICIdBNYDp3I1wI_5wk Message-ID: Subject: Re: [Caml-list] convertion between OCaml Big_int and C From: Jianzhou Zhao To: Olivier Schwander Cc: caml-list@yquem.inria.fr Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Spam: no; 0.00; ocaml:01 ocaml:01 integers:01 otherlibs:01 nat:01 otherlibs:01 nat:01 integers:01 numerix:01 mlgmp:01 numerix:01 cheers:01 beginner's:01 bug:01 zhao:98 On Wed, Oct 13, 2010 at 10:48 AM, Olivier Schwander wrote: > Le 13 Oct 2010 10:26, Jianzhou Zhao a =E9crit: >> 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. Thanks. Are they the MLGMP and Numerix listed in "the Caml Hump: General purpose libraries :: Numeric computation" ? http://caml.inria.fr/cgi-bin/hump.en.cgi?sort=3D0&browse=3D75 >>From the documents of Numerix, it runs much faster than the big_int library, although it may not be as portable as the 'nat' that big_int replies on. > > Cheers, > > Olivier > > _______________________________________________ > Caml-list mailing list. Subscription management: > http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list > Archives: http://caml.inria.fr > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs > --=20 Jianzhou