|
Boost : |
Subject: Re: [boost] Large Integer Library
From: Rafaël Fourquet (fourquet.d+boost_at_[hidden])
Date: 2012-06-30 11:10:53
>
> Please, if you have the time, download this library and give it a try.
> Any
> comments, or information upon its compatibility (or lack thereof) with
> compilers which are or are not listed would be greatly appreciated.
>
I started playing with your library using gcc 4.7.1 and it seems
compatible. I will definitely want to use it instead of my own unfinished
and probably buggy implementation. A few questions:
1) Could the programmer be given access (through member functions) to the
two members of a large_int? For example, I need a function to swap the high
and low bits of an integer-like value x. When x is of type large_int<T, T>,
I guess it would be more efficient to manipulate directly the two members
x.m_lo and x.m_hi instead of using the usual bit-operations.
2) The typedef for l[u]int128_t does not seem to use the builtin
corresponding type when available, could this be done?
3) I had "undefined symbol" problems when using the builtin 128 bits
integers (provided by gcc) in the signature of functions in a shared
library (it was a module created with Boost.Python, the problem occurred
when importing this module within python). The only solution I found was to
wrap integer-like types inside a (templated) class, which looks like a
particular case of your library (this would be "large_int<EMPTY_TYPE, U>").
Would LargeInt be an appropriate place to solve this problem?
4) Why use Boost.Operator for some operators but not all (e.g. comparison
operators)?
Thanks,
Rafael
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk