"applications must take care not to overflow the exponent"

Torbjorn Granlund tg at swox.com
Fri Jan 23 10:27:49 CET 2009

"Bruce M. Axtens" <bruce.axtens at gmail.com> writes:

  The manual says, "mpf functions and variables have no special notion of 
  infinity or not-a-number, and applications must take care not to 
  overflow the exponent or results will be unpredictable. This might 
  change in a future release."
   From a reactive point of view, how does one tell if one has overflowed 
  the exponent? Or, from the proactive, how can one tell if exponent 
  overflow is likely?
GMP's mpf does not provide any documented mechanisms for this,
unfortunately.  Perhaps it should detect it and send a signal, or
something like that.

Having said that, very few applications should risk overflowing the
exponent, since it is at least 32 bits (on any relevant computer) and
since the base is a limb.  Applications that could cause overflow, need
to check that intermediate results lie within a safety interval.


More information about the gmp-discuss mailing list