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 mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id 24680BBAF for ; Wed, 13 Oct 2010 16:26:46 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApMCAN9dtUxKfVIuimdsb2JhbACTLSuNbggVAQEBCgkMBw8FH6A9i2KGcCOIYQEBAwWFQwSKQYR/hBM X-IronPort-AV: E=Sophos;i="4.57,325,1283724000"; d="scan'208";a="61197211" Received: from mail-ww0-f46.google.com ([74.125.82.46]) by mail3-smtp-sop.national.inria.fr with ESMTP; 13 Oct 2010 16:26:45 +0200 Received: by wwb17 with SMTP id 17so915002wwb.3 for ; Wed, 13 Oct 2010 07:26:45 -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:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=nUue4W7KKo2Uoz0fVH4bcPG4kkVAROZmNdcrjLS90Xk=; b=OegKA20b+F/48D9sCYXc7vQ8LtGRT/zG5RLIeEbIEDZtqrTrwGbWFcq3gnA2IH8gek YvKr8N0EsSNo2tBXuHtN8z+5vfkh0r0F9dD/mEnP6XJ2lfzAXNq43G1QPR+fEOmB1j7f ZhPBjGDoz+ZEuJDAhaovHZcHsc9RCWoQvicQQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type; b=jS+dY1L1j/eKSu4V84AOXKdHu26ErdXP86HgjCVlfmQoZLAw9tkQ6poNd6DOuBC8Mc 4+PYRHP0K8zTMe7dRRERQZOP2nqrUwXOZceFFnytvMvvybOQ0Ey0PYVI+YySIKeg1Wm+ bjlv6ElOKo96tIMWHvcCXHpJHeGOkidpU5u8k= MIME-Version: 1.0 Received: by 10.216.185.4 with SMTP id t4mr8423262wem.87.1286980004709; Wed, 13 Oct 2010 07:26:44 -0700 (PDT) Sender: jianzhou.zh@gmail.com Received: by 10.216.229.193 with HTTP; Wed, 13 Oct 2010 07:26:44 -0700 (PDT) Date: Wed, 13 Oct 2010 10:26:44 -0400 X-Google-Sender-Auth: LxSHW1ZsW-c3HZSbcCiA-a4hhbc Message-ID: Subject: convertion between OCaml Big_int and C From: Jianzhou Zhao To: caml-list@yquem.inria.fr Content-Type: text/plain; charset=ISO-8859-1 X-Spam: no; 0.00; ocaml:01 ocaml:01 integers:01 otherlibs:01 nat:01 otherlibs:01 nat:01 integers:01 zhao:98 customized:98 upenn:01 functions:01 int:01 int:01 native:03 Hi All, 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. Thanks. -- Jianzhou