mpq_cmp_z

Torbjörn Granlund tg at gmplib.org
Wed Aug 26 16:26:41 UTC 2015


nisse at lysator.liu.se (Niels Möller) writes:

  "Marco Bodrato" <bodrato at mail.dm.unipi.it> writes:
  
  > My idea is to check if the den{ominator} is one by checking this condition:
  >
  > (SIZ(den) | PTR(den)[0]) == 1
  
  I think it is correct, assuming that at this point in the code it is
  known that SIZ(den) != 0 (and that den is normalized, so that SIZ(den)
  == 1 implies that PTR(den)[0] != 0).
  
Indeed a clever condition, helping Marco's quest against branches, a
condition which also depends on that we always allocate a limb at
PTR(mpz).

-- 
Torbjörn
Please encrypt, key id 0xC8601622


More information about the gmp-devel mailing list