Bitwise logic gmpxx.h problems

Marc Glisse marc.glisse at
Thu Jul 31 14:37:38 CEST 2008

On Thu, 31 Jul 2008, Torbjorn Granlund wrote:

>  > OK, I'll use the terse C++'y std::numeric_limits<double>::max_exponent.
>  I am not sure it is as portable as DBL_MAX_EXP from <cfloat>, but we'll
>  see. It's easy to switch anyway if one causes trouble.
> I indeed got some failures.  I'll try DBL_MAX_EXP next.

Could you tell which compilers failed, for future reference?

> Programming for C++ is real science, not plain computer science; you
> need to take an experimental approach as not even the C++ experts can
> tell what works and what does not work, or whether certain constructs
> are valid or invalid.  :-)

Yes, the experimental approach is nice. Looking at gmpxx as a compiler 
from c++ to gmp+c, I use ltrace to examine the generated gmp calls.

And things are going to change a lot with the new standard. Using rvalue 
references (a feature that basically gives temporary objects a different 
type) it should be possible to achieve results similar to the current 
gmpxx in a much simpler way. But that is not for right now.

Marc Glisse

More information about the gmp-bugs mailing list