signed/unsigned comparison with nails in mpz/mul_i.h

Torbjorn Granlund tg at swox.com
Mon Nov 17 15:15:06 CET 2008


Marc Glisse <marc.glisse at normalesup.org> writes:
  
  I noticed the following line of code in mpz/mul_i.h:
  
     if (small_mult <= GMP_NUMB_MAX)
  
  and I believe the intent was to write:
  
     if (sml <= GMP_NUMB_MAX)
  
  (sml is abs(small_mult)).
  
  It is not a bug since it only makes small negative integers use the slow 
  code meant for large integers (I will never get used to the behaviour of 
  signed/unsigned comparisons). And anyway it seems like the nails support 
  has already changed a lot for 4.3 so this may have been modified already.

It seems to have been improved already:

2008-02-27  Torbjorn Granlund  <tege at swox.com>

	* mpz/mul_i.h: Check sml's size (not the signed small_mult).

-- 
Torbjörn


More information about the gmp-bugs mailing list