Changeset 8ea64b in git for libpolys


Ignore:
Timestamp:
Apr 22, 2021, 4:03:15 PM (3 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', '2a584933abf2a2d3082034c7586d38bb6de1a30a')
Children:
5fd24e69d9cdfcd1040ca93af529563f039efd2c
Parents:
7760bca34e9c98f7c8b022a5aa89971f7d3a4fd7
Message:
fix: ndIsUnit, ndGetUnit
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libpolys/coeffs/numbers.cc

    r7760bc r8ea64b  
    119119}
    120120
    121 static BOOLEAN ndIsUnit(number a, const coeffs r) { return !r->cfIsZero(a,r); }
     121static BOOLEAN ndIsUnit(number a, const coeffs r)
     122{ return r->cfIsOne(a,r)|| r->cfIsMOne(a,r); }
     123static number ndGetUnit(number a, const coeffs r)
     124{ return r->cfInit(1,r); }
    122125#ifdef LDEBUG
    123126// static void   nDBDummy1(number* d,char *, int) { *d=NULL; }
     
    409412    n->cfDivBy = ndDivBy;
    410413    n->cfExtGcd = ndExtGcd;
    411     //n->cfGetUnit = (nMapFunc)NULL;
     414    n->cfGetUnit = ndGetUnit;
    412415#endif
    413416
     
    436439    if (n->cfSubringGcd==NULL) n->cfSubringGcd=n->cfGcd;
    437440
    438 #ifdef HAVE_RINGS
    439     if (n->cfGetUnit==NULL) n->cfGetUnit=n->cfCopy;
    440 #endif
    441441
    442442    if(n->cfWriteShort==NULL)
Note: See TracChangeset for help on using the changeset viewer.