Changeset 7152fa in git


Ignore:
Timestamp:
May 30, 2014, 4:52:30 PM (10 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
29cbfc58717330e765f1af9ef017a028621f797a
Parents:
75424e3a56f41323abd6d3f9936e00e102ff6a6d
Message:
more changes for 64bit: number representation in Q
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • Singular/LIB/paraplanecurves.lib

    r75424e r7152fa  
    19731973
    19741974///////////////////////////////////////////////////////////////////////////////
    1975 proc polyModP(poly q, bigint p)
     1975static proc polyModP(poly q, bigint p)
    19761976"USAGE:  polyModP(q, p); q poly, p bigint
    19771977RETURN:  takes each coefficient of q modulo p and returns the resulting poly
     
    20152015    return (-1);
    20162016  }
     2017
    20172018  /* For p > 32003, we use Cantor-Zassenhaus' algorithm: */
    20182019  def br = basering;
     
    21092110    // 3) lift (x1, x2, ..., xk) in Z/p1^e1 * ... * Z/pk^ek
    21102111    //    to x in Z/m via Chinese remainder theorem
     2112
    21112113    list roots;
    21122114    // 2.1):
  • libpolys/coeffs/longrat.cc

    r75424e r7152fa  
    271271    {
    272272        mpz_t dummy;
    273         mpz_init_set_si(dummy, SR_TO_INT(n)); 
    274         term = make_cf(dummy);   
     273        mpz_init_set_si(dummy, SR_TO_INT(n));
     274        term = make_cf(dummy);
    275275    }
    276276  }
     
    542542  nlTest(i, r);
    543543  nlNormalize(i,r);
    544   if (SR_HDL(i) & SR_INT) 
     544  if (SR_HDL(i) & SR_INT)
    545545  {
    546546    int dummy = SR_TO_INT(i);
     
    803803    LONG c=SR_TO_INT(a) % bb;
    804804    /*if(c < 0)
    805     {   
     805    {
    806806        if(bb < 0)
    807807            c = c - bb;
     
    820820  if (SR_HDL(a) & SR_INT)
    821821  {
    822     // a is a small and b is a large int: -> a 
     822    // a is a small and b is a large int: -> a
    823823    //  INCORRECT, IT COULD HAPPEN THAT b IS A SMALL NUMBER
    824     number aa;
    825     aa=ALLOC_RNUMBER();
     824    number aa=ALLOC_RNUMBER();
    826825    mpz_init(aa->z);
    827826    mpz_set_si(aa->z, SR_TO_INT(a));
     
    831830#endif
    832831    u->s = 3;
    833     mpz_init(u->z); 
     832    mpz_init(u->z);
    834833    mpz_mod(u->z,aa->z,b->z);
    835834    if (mpz_isNeg(u->z))
    836835    {
    837         if (mpz_isNeg(b->z))
    838           mpz_sub(u->z,aa->z,b->z);
    839         else
    840           mpz_add(u->z,aa->z,b->z);
     836      if (mpz_isNeg(b->z))
     837        mpz_sub(u->z,aa->z,b->z);
     838      else
     839        mpz_add(u->z,aa->z,b->z);
    841840    }
    842841    /*mpz_t dummy;
     
    855854    }
    856855    mpz_clear(dummy);*/
    857     if (aa!=NULL)
    858     {
    859       mpz_clear(aa->z);
     856    mpz_clear(aa->z);
    860857    #if defined(LDEBUG)
    861       aa->debug=654324;
     858    aa->debug=654324;
    862859    #endif
    863       FREE_RNUMBER(aa);
    864     }
     860    FREE_RNUMBER(aa);
    865861    u=nlShort3(u);
    866862    nlTest(u,r);
     
    29852981         s_readmpz(f,n->z);
    29862982         n->s=3; /*sub_type*/
     2983         #if SIZEOF_LONG == 8
     2984         n=nlShort3(n);
     2985         #endif
    29872986         return n;
    29882987       }
     
    30113010         s_readmpz_base (f,n->z, SSI_BASE);
    30123011         n->s=sub_type=3; /*subtype-5*/
     3012         #if SIZEOF_LONG == 8
     3013         n=nlShort3(n);
     3014         #endif
    30133015         return n;
    30143016       }
Note: See TracChangeset for help on using the changeset viewer.