caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Thomas Braibant <thomas.braibant@gmail.com>
To: Xavier Leroy <Xavier.Leroy@inria.fr>
Cc: OCaML Mailing List <caml-list@inria.fr>
Subject: Re: [Caml-list] Arbitrary precision unsigned integers
Date: Tue, 20 May 2014 16:33:07 +0100	[thread overview]
Message-ID: <CAHR=VkypC1r92zUbJ2s_Un0N+84WQfbARBhNU=teKQabtxTn0g@mail.gmail.com> (raw)
In-Reply-To: <CAH=h3gEAGxAnyQAYiyXFiFb62om3E7hxVANEd8183iGxAAcqhQ@mail.gmail.com>

Thanks for the quick reply. I guess I will do exactly that and release
the wrapper library.


On Tue, May 20, 2014 at 4:29 PM, Xavier Leroy <Xavier.Leroy@inria.fr> wrote:
> Hi Thomas,
>
> In a pinch, you can use Zarith and follow each arithmetic operation by a
> Z.extract or Z.signed_extract operation to normalize the result to the
> desired range (N-bit unsigned or N-bit signed).  It's not as fast as it
> could be, but should be reasonably efficient.
>
> - Xavier Leroy
>
>
>
> 2014-05-20 17:18 GMT+02:00 Thomas Braibant <thomas.braibant@gmail.com>:
>>
>> Hi list,
>>
>>
>> I wonder if there is a publicly available library that implements
>> arbitrary precision (un)signed integers. I could not find anything
>> relevant with Google, nor on Opam.
>>
>> By arbitrary, I mean that I want to implement e.g., 43 bits unsigned
>> arithmetic, and have the right overflow behaviors. I know of zarith
>> which seems to implement arbitrary precision in the sense that the
>> precision of the numbers grows as needed.
>>
>> Best,
>> Thomas
>>
>> --
>> Caml-list mailing list.  Subscription management and archives:
>> https://sympa.inria.fr/sympa/arc/caml-list
>> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
>> Bug reports: http://caml.inria.fr/bin/caml-bugs
>>
>

      reply	other threads:[~2014-05-20 15:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-20 15:18 Thomas Braibant
2014-05-20 15:29 ` Xavier Leroy
2014-05-20 15:33   ` Thomas Braibant [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAHR=VkypC1r92zUbJ2s_Un0N+84WQfbARBhNU=teKQabtxTn0g@mail.gmail.com' \
    --to=thomas.braibant@gmail.com \
    --cc=Xavier.Leroy@inria.fr \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).