Changeset d681e8 in git


Ignore:
Timestamp:
May 19, 2007, 3:22:23 PM (16 years ago)
Author:
Oliver Wienand <wienand@…>
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'cdfcdb8287f66bc6070028082cbbc6eff10e609b')
Children:
aef8bb403e723cf3c64015379df7cbc448fbb3b3
Parents:
1591a873ae939d12cc28f2fbb1408a9e8fdad9b8
Message:
kInline.cc, kutil.h:
new: k_GetStringLeadTerms

kutil.cc:
lots of KDEBUG messages inside of HAVE_RINGS switches
added ntl xgcd import
new procs:
enterOneStrongPoly
initenterstrongPairs

rmodulon.cc:
nrnLcm small error
Question: Is x == modul Then return 0 faster than return x % modul?
nrnComp missing case corrected
intDiv(0,0) = 0, intDiv(0,1) = 1, intDiv(0, a) = modul DIV a

rmodulo2m.cc:
intDiv(0,0) = 0, intDiv(0,1) = 1, intDiv(0, a) = modul DIV a


git-svn-id: file:///usr/local/Singular/svn/trunk@10051 2c84dea3-7e68-4137-9b89-c4e89433aadc
Location:
kernel
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • kernel/kInline.cc

    r1591a87 rd681e8  
    77 *  Author:  obachman (Olaf Bachmann)
    88 *  Created: 8/00
    9  *  Version: $Id: kInline.cc,v 1.5 2007-02-01 18:22:35 Singular Exp $
     9 *  Version: $Id: kInline.cc,v 1.6 2007-05-19 13:22:22 wienand Exp $
    1010 *******************************************************************/
    1111#ifndef KINLINE_CC
     
    958958}
    959959
     960#ifdef HAVE_RINGS
     961// get m1 = LCM(LM(p1), LM(p2))/LM(p1)
     962//     m2 = LCM(LM(p1), LM(p2))/LM(p2)   in tailRing
     963//    lcm = LCM(LM(p1), LM(p2)           in leadRing
     964KINLINE BOOLEAN k_GetStrongLeadTerms(const poly p1, const poly p2, const ring leadRing,
     965                               poly &m1, poly &m2, poly &lcm, const ring tailRing)
     966{
     967  p_LmCheckPolyRing(p1, leadRing);
     968  p_LmCheckPolyRing(p2, leadRing);
     969
     970  int i;
     971  Exponent_t x;
     972  Exponent_t e1;
     973  Exponent_t e2;
     974  Exponent_t s;
     975  m1 = p_Init(tailRing);
     976  m2 = p_Init(tailRing);
     977  lcm = p_Init(leadRing);
     978
     979  for (i = leadRing->N; i; i--)
     980  {
     981    e1 = p_GetExp(p1,i,leadRing);
     982    e2 = p_GetExp(p2,i,leadRing);
     983    x = e1 - e2;
     984    s = e1 + e2;
     985    if (x > 0)
     986    {
     987      p_SetExp(m2,i,x, tailRing);
     988      p_SetExp(m1,i,0, tailRing);
     989    }
     990    else
     991    {
     992      p_SetExp(m1,i,-x, tailRing);
     993      p_SetExp(m2,i,0, tailRing);
     994    }
     995    p_SetExp(lcm,i,s, leadRing);
     996  }
     997
     998  p_Setm(m1, tailRing);
     999  p_Setm(m2, tailRing);
     1000  p_Setm(lcm, leadRing);
     1001  return TRUE;
     1002
     1003  false_return:
     1004  p_LmFree(m1, tailRing);
     1005  p_LmFree(m2, tailRing);
     1006  m1 = m2 = NULL;
     1007  return FALSE;
     1008}
     1009#endif
     1010
    9601011/***************************************************************
    9611012 *
  • kernel/kutil.cc

    r1591a87 rd681e8  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: kutil.cc,v 1.53 2007-05-11 10:48:04 wienand Exp $ */
     4/* $Id: kutil.cc,v 1.54 2007-05-19 13:22:22 wienand Exp $ */
    55/*
    66* ABSTRACT: kernel: utils for kStd
     
    10311031  /*- computes the lcm(s[i],p) -*/
    10321032  Lp.lcm = pInit();
    1033 
     1033  pSetCoeff(Lp.lcm, nLcm(pGetCoeff(p), pGetCoeff(strat->S[i]), currRing));
     1034  // Lp.lcm == 0
     1035  if (pGetCoeff(Lp.lcm) == NULL)
     1036  {
     1037#ifdef KDEBUG
     1038      if (TEST_OPT_DEBUG)
     1039      {
     1040        PrintS("--- Lp.lcm == 0\n");
     1041        PrintS("p:");
     1042        wrp(p);
     1043        Print("  strat->S[%d]:", i);
     1044        wrp(strat->S[i]);
     1045        PrintLn();
     1046      }
     1047#endif
     1048      strat->cp++;
     1049      pLmFree(Lp.lcm);
     1050      Lp.lcm=NULL;
     1051      return;
     1052  }
     1053  // basic product criterion
    10341054  pLcm(p,strat->S[i],Lp.lcm);
    10351055  pSetm(Lp.lcm);
    1036   pSetCoeff(Lp.lcm, nLcm(pGetCoeff(p), pGetCoeff(strat->S[i]), currRing));
    10371056  assume(!strat->sugarCrit);
    1038   // basic product criterion
    1039   if (pHasNotCF(p,strat->S[i]) && (long) pGetCoeff(p) % 2 == 1 && (long) pGetCoeff(strat->S[i]) % 2 == 1)
    1040   {
     1057  if (pHasNotCF(p,strat->S[i]) && nIsOne(nGcd(0, pGetCoeff(p), currRing)) && nIsOne(nGcd(0, pGetCoeff(strat->S[i]), currRing)))
     1058  {
     1059#ifdef KDEBUG
     1060      if (TEST_OPT_DEBUG)
     1061      {
     1062        PrintS("--- product criterion func enterOnePairRing type 1\n");
     1063        PrintS("p:");
     1064        wrp(p);
     1065        Print("  strat->S[%d]:", i);
     1066        wrp(strat->S[i]);
     1067        PrintLn();
     1068      }
     1069#endif
    10411070      strat->cp++;
    10421071      pLmFree(Lp.lcm);
     
    10601089      {
    10611090        strat->c3++;
     1091#ifdef KDEBUG
     1092        if (TEST_OPT_DEBUG)
     1093        {
     1094          PrintS("--- chain criterion type 1\n");
     1095          PrintS("strat->B[j]:");
     1096          wrp(strat->B[j].lcm);
     1097          PrintS("  Lp.lcm:");
     1098          wrp(Lp.lcm);
     1099          PrintLn();
     1100        }
     1101#endif
    10621102        if ((strat->fromQ==NULL) || (isFromQ==0) || (strat->fromQ[i]==0))
    10631103        {
     
    10701110      if (compare == -1)
    10711111      {
     1112#ifdef KDEBUG
     1113        if (TEST_OPT_DEBUG)
     1114        {
     1115          PrintS("--- chain criterion type 2\n");
     1116          Print("strat->B[%d].lcm:",j);
     1117          wrp(strat->B[j].lcm);
     1118          PrintS("  Lp.lcm:");
     1119          wrp(Lp.lcm);
     1120          PrintLn();
     1121        }
     1122#endif
    10721123        deleteInL(strat->B,&strat->Bl,j,strat);
    10731124        strat->c3++;
    10741125      }
    10751126    }
    1076     if (compare == pDivComp_EQUAL)
    1077     {
    1078       // Add hint for same LM and direction of LC (later) (TODO Oliver)
     1127    if ((compare == pDivComp_EQUAL) && (compareCoeff != 2))
     1128    {
    10791129      if (compareCoeff == pDivComp_LESS)
    10801130      {
     1131#ifdef KDEBUG
     1132        if (TEST_OPT_DEBUG)
     1133        {
     1134          PrintS("--- chain criterion type 3\n");
     1135          Print("strat->B[%d].lcm:", j);
     1136          wrp(strat->B[j].lcm);
     1137          PrintS("  Lp.lcm:");
     1138          wrp(Lp.lcm);
     1139          PrintLn();
     1140        }
     1141#endif
    10811142        strat->c3++;
    10821143        if ((strat->fromQ==NULL) || (isFromQ==0) || (strat->fromQ[i]==0))
     
    10881149      }
    10891150      else
    1090       if (compareCoeff == pDivComp_GREATER)
    1091       {
     1151      // Add hint for same LM and LC (later) (TODO Oliver)
     1152      // if (compareCoeff == pDivComp_GREATER)
     1153      {
     1154#ifdef KDEBUG
     1155        if (TEST_OPT_DEBUG)
     1156        {
     1157          PrintS("--- chain criterion type 4\n");
     1158          Print("strat->B[%d].lcm:", j);
     1159          wrp(strat->B[j].lcm);
     1160          PrintS("  Lp.lcm:");
     1161          wrp(Lp.lcm);
     1162          PrintLn();
     1163        }
     1164#endif
    10921165        deleteInL(strat->B,&strat->Bl,j,strat);
    10931166        strat->c3++;
     
    10991172  */
    11001173  /*-  compute the short s-polynomial -*/
    1101   if ((strat->S[i]==NULL) || (p==NULL)) return;
     1174  if ((strat->S[i]==NULL) || (p==NULL)) {
     1175#ifdef KDEBUG
     1176    if (TEST_OPT_DEBUG)
     1177    {
     1178      PrintS("--- spoly = NULL\n");
     1179    }
     1180#endif
     1181    return;
     1182  }
    11021183  pNorm(p);
    11031184  if ((strat->fromQ!=NULL) && (isFromQ!=0) && (strat->fromQ[i]!=0))
     
    11131194  if (Lp.p == NULL)
    11141195  {
     1196#ifdef KDEBUG
     1197    if (TEST_OPT_DEBUG)
     1198    {
     1199      PrintS("--- spoly = NULL\n");
     1200    }
     1201#endif
    11151202    /*- the case that the s-poly is 0 -*/
    11161203    if (strat->pairtest==NULL) initPairtest(strat);
     
    11451232    l = strat->posInL(strat->B,strat->Bl,&Lp,strat);
    11461233    enterL(&strat->B,&strat->Bl,&strat->Bmax,Lp,l);
     1234  }
     1235}
     1236
     1237
     1238/*2
     1239* put the  lcm(s[i],p)  into the set B
     1240*/
     1241
     1242#include <NTL/ZZ.h>
     1243#ifdef NTL_CLIENT
     1244NTL_CLIENT
     1245#endif
     1246
     1247void enterOneStrongPoly (int i,poly p,int ecart, int isFromQ,kStrategy strat, int atR = -1)
     1248{
     1249  long d, s, t;
     1250  assume(i<=strat->sl);
     1251  LObject  Lp;
     1252  poly m1, m2, erg, gcd;
     1253
     1254  XGCD(d, s, t, (long) pGetCoeff(p), (long) pGetCoeff(strat->S[i]));
     1255
     1256
     1257  k_GetStrongLeadTerms(p, strat->S[i], currRing, m1, m2, gcd, strat->tailRing);
     1258
     1259  pSetCoeff0(m1, (number) t);
     1260  pSetCoeff0(m2, (number) s);
     1261  pSetCoeff0(gcd, (number) d);
     1262
     1263
     1264#ifdef KDEBUG
     1265  if (TEST_OPT_DEBUG)
     1266  {
     1267    Print("t = %d; s = %d; d = %d\n", t, s, d);
     1268    PrintS("--- create strong gcd poly: ");
     1269    wrp(p);
     1270    Print("\n strat->S[%d]: ", i);
     1271    wrp(strat->S[i]);
     1272    PrintS(" ---> ");
     1273  }
     1274#endif
     1275
     1276  erg = p_Add_q(pp_Mult_mm(pNext(p), m1, strat->tailRing), pp_Mult_mm(pNext(strat->S[i]), m2, strat->tailRing), strat->tailRing);
     1277  pNext(gcd) = erg;
     1278
     1279#ifdef KDEBUG
     1280    if (TEST_OPT_DEBUG)
     1281    {
     1282      wrp(gcd);
     1283      PrintLn();
     1284    }
     1285#endif
     1286
     1287  LObject h;
     1288  h.p = gcd;
     1289  h.tailRing = strat->tailRing;
     1290  int posx;
     1291  if (h.p!=NULL)
     1292  {
     1293    if (TEST_OPT_INTSTRATEGY)
     1294    {
     1295      h.pCleardenom(); // also does a pContent
     1296    }
     1297    else
     1298    {
     1299      h.pNorm();
     1300    }
     1301    strat->initEcart(&h);
     1302    if (strat->Ll==-1)
     1303      posx =0;
     1304    else
     1305      posx = strat->posInL(strat->L,strat->Ll,&h,strat);
     1306    h.sev = pGetShortExpVector(h.p);
     1307    h.t_p = k_LmInit_currRing_2_tailRing(h.p, strat->tailRing);
     1308    if (pNext(p) != NULL)
     1309    {
     1310      // What does this? (Oliver)
     1311      // pShallowCopyDeleteProc p_shallow_copy_delete
     1312      //      = pGetShallowCopyDeleteProc(strat->tailRing, new_tailRing);
     1313      // pNext(p) = p_shallow_copy_delete(pNext(p),
     1314      //              currRing, strat->tailRing, strat->tailRing->PolyBin);
     1315    }
     1316    enterL(&strat->L,&strat->Ll,&strat->Lmax,h,posx);
    11471317  }
    11481318}
     
    17991969            if (pDivisibleBy(strat->S[j],strat->B[i].lcm))
    18001970            {
     1971#ifdef KDEBUG
     1972              if (TEST_OPT_DEBUG)
     1973              {
     1974                PrintS("--- chain criterion func chainCritRing type 1\n");
     1975                PrintS("strat->S[j]:");
     1976                wrp(strat->S[j]);
     1977                PrintS("  strat->B[i].lcm:");
     1978                wrp(strat->B[i].lcm);
     1979                PrintLn();
     1980              }
     1981#endif
    18011982              deleteInL(strat->B,&strat->Bl,i,strat);
    18021983              strat->c3++;
     
    18121993  for (j=strat->Ll; j>=0; j--)
    18131994  {
    1814     if (strat->L[j].lcm != NULL && nGreater(pGetCoeff(strat->L[j].lcm), pGetCoeff(p)))
     1995    if (strat->L[j].lcm != NULL && nDivBy(pGetCoeff(strat->L[j].lcm), pGetCoeff(p)))
    18151996    {
    18161997      if (pCompareChain(p,strat->L[j].p1,strat->L[j].p2,strat->L[j].lcm))
     
    18202001          deleteInL(strat->L,&strat->Ll,j,strat);
    18212002          strat->c3++;
    1822           // Print("|UL|");
     2003#ifdef KDEBUG
     2004              if (TEST_OPT_DEBUG)
     2005              {
     2006                PrintS("--- chain criterion func chainCritRing type 2\n");
     2007                PrintS("strat->L[j].p:");
     2008                wrp(strat->L[j].p);
     2009                PrintS("  p:");
     2010                wrp(p);
     2011                PrintLn();
     2012              }
     2013#endif
    18232014        }
    18242015      }
     
    18612052        if (i < 0)  break;
    18622053        // Element is from B and has the same lcm as L[j]
    1863         if ((strat->L[i].p2 == p) && nGreater(pGetCoeff(strat->L[j].lcm), pGetCoeff(strat->L[i].lcm))
     2054        if ((strat->L[i].p2 == p) && nDivBy(pGetCoeff(strat->L[j].lcm), pGetCoeff(strat->L[i].lcm))
    18642055             && pLmEqual(strat->L[j].lcm,strat->L[i].lcm))
    18652056        {
    18662057          /*L[i] could be canceled but we search for a better one to cancel*/
    18672058          strat->c3++;
    1868           // Print("|EP|");
     2059#ifdef KDEBUG
     2060          if (TEST_OPT_DEBUG)
     2061          {
     2062            PrintS("--- chain criterion func chainCritRing type 3\n");
     2063            PrintS("strat->L[j].lcm:");
     2064            wrp(strat->L[j].lcm);
     2065            PrintS("  strat->L[i].lcm:");
     2066            wrp(strat->L[i].lcm);
     2067            PrintLn();
     2068          }
     2069#endif
    18692070          if (isInPairsetL(i-1,strat->L[j].p1,strat->L[i].p1,&l,strat)
    18702071          && (pNext(strat->L[l].p) == strat->tail)
     
    23362537          {
    23372538            new_pair=TRUE;
     2539            Print("TODO Oliver --- j:%d, Ll:%d\n",j,strat->Ll);
    23382540            enterOnePairRing(j,h,ecart,isFromQ,strat, atR);
    2339             Print("j:%d, Ll:%d\n",j,strat->Ll);
    23402541          }
    23412542        }
     
    23462547        for (j=0; j<=k; j++)
    23472548        {
     2549          // Print("j:%d, Ll:%d\n",j,strat->Ll);
    23482550          enterOnePairRing(j,h,ecart,isFromQ,strat, atR);
    2349           // Print("j:%d, Ll:%d\n",j,strat->Ll);
    23502551        }
    23512552      }
     
    23582559        {
    23592560          new_pair=TRUE;
     2561          Print("TODO Oliver --- j:%d, Ll:%d\n",j,strat->Ll);
    23602562          enterOnePairRing(j,h,ecart,isFromQ,strat, atR);
    2361           Print("j:%d, Ll:%d\n",j,strat->Ll);
    23622563        }
    23632564      }
     
    23702571    if (new_pair) chainCritRing(h,ecart,strat);
    23712572
     2573  }
     2574/*
     2575ring r=256,(x,y,z),dp;
     2576ideal I=12xz-133y, 2xy-z;
     2577*/
     2578
     2579}
     2580
     2581/*2
     2582*(s[0],h),...,(s[k],h) will be put to the pairset L
     2583*/
     2584void initenterstrongPairs (poly h,int k,int ecart,int isFromQ,kStrategy strat, int atR = -1)
     2585{
     2586
     2587  if (!nIsOne(pGetCoeff(h)))
     2588  {
     2589    int j;
     2590    BOOLEAN new_pair=FALSE;
     2591
     2592    for (j=0; j<=k; j++)
     2593    {
     2594      // Print("j:%d, Ll:%d\n",j,strat->Ll);
     2595      if (((unsigned long) pGetCoeff(h) % (unsigned long) pGetCoeff(strat->S[j]) != 0) &&
     2596         ((unsigned long) pGetCoeff(strat->S[j]) % (unsigned long) pGetCoeff(h) != 0))
     2597      {
     2598        new_pair=TRUE;
     2599        enterOneStrongPoly(j,h,ecart,isFromQ,strat, atR);
     2600      }
     2601    }
    23722602  }
    23732603/*
     
    24032633        PrintS("Z");
    24042634      }
     2635#ifdef KDEBUG
     2636      if (TEST_OPT_DEBUG)
     2637      {
     2638        PrintS("--- create zero spoly: ");
     2639        wrp(h);
     2640        PrintS(" ---> ");
     2641      }
     2642#endif
    24052643      poly tmp = p_ISet((long) ((p)->coef), currRing);
    24062644      for (int i = 1; i <= currRing->N; i++)
     
    24422680          //              currRing, strat->tailRing, strat->tailRing->PolyBin);
    24432681        }
     2682#ifdef KDEBUG
     2683        if (TEST_OPT_DEBUG)
     2684        {
     2685          wrp(tmp);
     2686          PrintLn();
     2687        }
     2688#endif
    24442689        enterL(&strat->L,&strat->Ll,&strat->Lmax,h,posx);
    24452690      }
     
    24562701  ))
    24572702  {
    2458     //Print("start clearS k=%d, pos=%d, sl=%d\n",k,pos,strat->sl);
     2703    // Print("start clearS k=%d, pos=%d, sl=%d\n",k,pos,strat->sl);
    24592704    unsigned long h_sev = pGetShortExpVector(h);
    24602705    loop
     
    24642709      j++;
    24652710    }
    2466     //Print("end clearS sl=%d\n",strat->sl);
     2711    // Print("end clearS sl=%d\n",strat->sl);
    24672712  }
    24682713}
     
    24782723    enterExtendedSpoly(h, strat);
    24792724    initenterpairsRing(h, k, ecart, 0, strat, atR);
     2725    initenterstrongPairs(h, k, ecart, 0, strat, atR);
    24802726    clearSbatch(h, k, pos, strat);
    24812727}
     
    24902736  int j=pos;
    24912737
     2738  assume (!rField_is_Ring(currRing));
    24922739  initenterpairs(h,k,ecart,0,strat, atR);
    24932740  if ( (!strat->fromT)
  • kernel/kutil.h

    r1591a87 rd681e8  
    44*  Computer Algebra System SINGULAR     *
    55****************************************/
    6 /* $Id: kutil.h,v 1.23 2007-05-11 10:48:04 wienand Exp $ */
     6/* $Id: kutil.h,v 1.24 2007-05-19 13:22:22 wienand Exp $ */
    77/*
    88* ABSTRACT: kernel: utils for kStd
     
    493493KINLINE BOOLEAN k_GetLeadTerms(const poly p1, const poly p2, const ring p_r,
    494494                               poly &m1, poly &m2, const ring m_r);
     495#ifdef HAVE_RINGS
     496KINLINE BOOLEAN k_GetStrongLeadTerms(const poly p1, const poly p2, const ring leadRing,
     497                               poly &m1, poly &m2, poly &lcm, const ring taiRing);
     498#endif
    495499#ifdef KDEBUG
    496500// test strat
  • kernel/polys.cc

    r1591a87 rd681e8  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: polys.cc,v 1.17 2007-05-11 10:48:04 wienand Exp $ */
     4/* $Id: polys.cc,v 1.18 2007-05-19 13:22:23 wienand Exp $ */
    55
    66/*
     
    691691#ifdef HAVE_RINGS  //HACK TODO Oliver
    692692number nGetUnit(number k) {
    693   return (number) nIntDiv(k, nGcd(k, 0, currRing));
     693  number unit = nIntDiv(k, nGcd(k, 0, currRing));
     694  number gcd = nGcd(unit, 0, currRing);
     695  if (!nIsOne(gcd))
     696  {
     697    number tmp = nMult(unit, unit);
     698    number gcd_new = nGcd(tmp, 0, currRing);
     699    while (gcd_new != gcd)
     700    {
     701      gcd = gcd_new;
     702      tmp = nMult(tmp, unit);
     703      gcd_new = nGcd(tmp, 0, currRing);
     704    }
     705    unit = nAdd(unit, nIntDiv(0, gcd_new));
     706  }
     707  return unit;
    694708}
    695709#endif
  • kernel/rmodulo2m.cc

    r1591a87 rd681e8  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: rmodulo2m.cc,v 1.9 2007-05-11 10:48:05 wienand Exp $ */
     4/* $Id: rmodulo2m.cc,v 1.10 2007-05-19 13:22:23 wienand Exp $ */
    55/*
    66* ABSTRACT: numbers modulo 2^m
     
    300300    if ((NATNUMBER)b==0)
    301301      return (number) 1;
     302    if ((NATNUMBER)b==1)
     303      return (number) 0;
    302304    return (number) (nr2mModul / (NATNUMBER) b);
    303305  }
  • kernel/rmodulon.cc

    r1591a87 rd681e8  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: rmodulon.cc,v 1.3 2007-05-11 10:48:05 wienand Exp $ */
     4/* $Id: rmodulon.cc,v 1.4 2007-05-19 13:22:23 wienand Exp $ */
    55/*
    66* ABSTRACT: numbers modulo n
     
    7777number nrnLcm (number a,number b,ring r)
    7878{
    79   return (number) (XSGCD2(nrnModul, (NATNUMBER) a) * XSGCD2(nrnModul, (NATNUMBER) b) / XSGCD3(nrnModul, (NATNUMBER) a, (NATNUMBER) b));
     79  NATNUMBER erg = XSGCD2(nrnModul, (NATNUMBER) a) * XSGCD2(nrnModul, (NATNUMBER) b) / XSGCD3(nrnModul, (NATNUMBER) a, (NATNUMBER) b);
     80  if (erg == nrnModul) return NULL;   // Schneller als return erg % nrnModul ?
     81  return (number) erg;
    8082}
    8183
     
    167169   NATNUMBER as = XSGCD2((NATNUMBER) a, nrnModul);
    168170   if (bs == as) return 0;
    169    if (as % bs == 0) return 1;
    170    return -1;
     171   if (as % bs == 0) return -1;
     172   if (bs % as == 0) return 1;
     173   return 2;
    171174}
    172175
     
    278281    if ((NATNUMBER)b==0)
    279282      return (number) 1;
     283    if ((NATNUMBER)b==1)
     284      return (number) 0;
    280285    return (number) ( nrnModul / (NATNUMBER) b);
    281286  }
Note: See TracChangeset for help on using the changeset viewer.