Changeset 9f4478 in git for libpolys/coeffs/longrat.cc


Ignore:
Timestamp:
Dec 7, 2012, 10:16:34 AM (11 years ago)
Author:
Martin Lee <martinlee84@…>
Branches:
(u'spielwiese', '17f1d200f27c5bd38f5dfc6e8a0879242279d1d8')
Children:
8c676add407dd38a5206615ae14dd960bf1dae94
Parents:
e56eb1a64bb1558adb50e50d7905647565cbf4ef
git-author:
Martin Lee <martinlee84@web.de>2012-12-07 10:16:34+01:00
git-committer:
Martin Lee <martinlee84@web.de>2012-12-07 10:46:35+01:00
Message:
fix: missing changes from master
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libpolys/coeffs/longrat.cc

    re56eb1a r9f4478  
    25452545    if (mpz_cmp(tmp,P)<0)
    25462546    {
    2547        // return N/B
    2548        z=ALLOC_RNUMBER();
    2549        #ifdef LDEBUG
    2550        z->debug=123456;
    2551        #endif
    25522547       if (mpz_isNeg(B))
    25532548       {
     
    25552550         mpz_neg(N,N);
    25562551       }
    2557        mpz_init_set(z->z,N);
    2558        mpz_init_set(z->n,B);
    2559        z->s = 0;
    2560        nlNormalize(z,r);
     2552       // check for gcd(N,B)==1
     2553       mpz_gcd(tmp,N,B);
     2554       if (mpz_cmp_ui(tmp,1)==0)
     2555       {
     2556         // return N/B
     2557         z=ALLOC_RNUMBER();
     2558         #ifdef LDEBUG
     2559         z->debug=123456;
     2560         #endif
     2561         mpz_init_set(z->z,N);
     2562         mpz_init_set(z->n,B);
     2563         z->s = 0;
     2564         nlNormalize(z,r);
     2565       }
     2566       else
     2567       {
     2568         // return nN (the input) instead of "fail"
     2569         z=nlCopy(nN,r);
     2570       }
    25612571       break;
    25622572    }
Note: See TracChangeset for help on using the changeset viewer.