Changeset 98a94b in git for libpolys/coeffs/modulop.h


Ignore:
Timestamp:
Apr 26, 2018, 4:26:40 PM (6 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
e4c8dc9ef21f56d682d47ce39530ce221c22dd44
Parents:
2ba25ee7ea3c483c73847576db73cb6464bc67ba
Message:
fix: special case (GA,!GM): in mult
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libpolys/coeffs/modulop.h

    r2ba25e r98a94b  
    7474  long x = (long)r->npLogTable[(long)a]+ r->npLogTable[(long)b];
    7575  #ifdef HAVE_GENERIC_ADD
    76   if (x>r->npPminus1M) x-=r->npPminus1M;
     76    if (x>=r->npPminus1M) x-=r->npPminus1M;
    7777  #else
    7878    x-=r->npPminus1M;
    7979    #if SIZEOF_LONG == 8
    80      x += (x >> 63) & r->npPminus1M;
     80      x += (x >> 63) & r->npPminus1M;
    8181    #else
    82      x += (x >> 31) & r->npPminus1M;
     82      x += (x >> 31) & r->npPminus1M;
    8383    #endif
    8484  #endif
     
    8989  long x = (long)r->npLogTable[(long)a]+ r->npLogTable[(long)b];
    9090  #ifdef HAVE_GENERIC_ADD
    91   if (x>r->npPminus1M) x-=r->npPminus1M;
     91    if (x>=r->npPminus1M) x-=r->npPminus1M;
    9292  #else
    9393    x-=r->npPminus1M;
    9494    #if SIZEOF_LONG == 8
    95      x += (x >> 63) & r->npPminus1M;
     95      x += (x >> 63) & r->npPminus1M;
    9696    #else
    97      x += (x >> 31) & r->npPminus1M;
     97      x += (x >> 31) & r->npPminus1M;
    9898    #endif
    9999  #endif
     
    268268long    npInt         (number &n, const coeffs r);
    269269
     270// The folloing is reused inside tgb*.cc
     271number  npMult        (number a, number b, const coeffs r);
    270272// The following is currently used in OPAE.cc, OPAEQ.cc and OPAEp.cc for setting their SetMap...
    271273nMapFunc npSetMap(const coeffs src, const coeffs dst); // FIXME! BUG?
Note: See TracChangeset for help on using the changeset viewer.