Subject: Re: [boost] Large Integer Library
From: Michael Tryhorn (mjtryhorn_at_[hidden])
Date: 2012-06-30 08:23:36
To be honest, I haven't had a chance to look at the Multiprecision library
depth. However, I have had a quick read through the documentation and have
found a few points of difference, although there may be others:
(All taken from
* "Fixed at compile time values, for example 50 decimal digits"
Boost.LargeInt is designed to stick-together two existing integer or
like types, so although also being fixed at compile-time, it is fixed to a
number of binary-bits rather than decimal digits.
* "A header-only Boost license version is always available (if somewhat
Boost.LargeInt is solely header and template based, and so is fully
with, Boost License v1.0 without restriction. So, it performs as optimally
possible regardless of licensing requirements.
* "Mixing arithmetic operations using types of different precision is
Boost.LargeInt has been specifically designed to avoid such restrictions -
where two integers of differing precision are compared the smaller of the
is automatically promoted to be the same type as the larger. Them emphasis
always been upon being "as simple as possible". For example, for 128bit
support, all one would need is the pre-existing boost::large_int::lint128_t
type to take the initial value and any calculation, and a
boost::large_int::large_int_cast<C>(value) to convert from 128bit to a
built-in integer type, if needed.
* "You have to be careful to cast the result of an expression to the actual
number type when passing an expression to a template function"
The results of all arithmetic operators in Boost.LargeInt are themselves
boost::large_int::large_int based types, and so their use is fully
Please note that as all boost::large_int::large_int based types are
integer-like, Boost.Multiprecision may even be interoperable with them. If
are free to give it a try, I would welcome any input.
Michael J. Tryhorn
On 30 June 2012 12:52, John Maddock <boost.regex_at_[hidden]> wrote:
> I have written a Boost-compatible library for the representation and
>> manipulation of integers of large or arbitrary size (including 128bit and
>> above). I would like to make a preliminary submission of this library for
>> your review and input, for potential inclusion into Boost v1.51.0 or
>> as per the Boost Library Submission Process.
> How does this differ from Boost.Multiprecision currently being reviewed?
> Thanks, John.
> Unsubscribe & other changes: http://lists.boost.org/**
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk