Changeset 98a94b in git


Ignore:
Timestamp:
Apr 26, 2018, 4:26:40 PM (5 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', '8e0ad00ce244dfd0756200662572aef8402f13d5')
Children:
e4c8dc9ef21f56d682d47ce39530ce221c22dd44
Parents:
2ba25ee7ea3c483c73847576db73cb6464bc67ba
Message:
fix: special case (GA,!GM): in mult
Location:
libpolys/coeffs
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • libpolys/coeffs/modulop.cc

    r2ba25e r98a94b  
    164164  int s = r->npLogTable[(long)a] - r->npLogTable[(long)b];
    165165  #ifdef HAVE_GENERIC_ADD
    166   if (s < 0)
    167     s += r->npPminus1M;
     166    if (s < 0)
     167      s += r->npPminus1M;
    168168  #else
    169169    #if SIZEOF_LONG == 8
  • 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.