Changeset d07137 in git for factory/NTLconvert.cc


Ignore:
Timestamp:
Oct 15, 2003, 7:19:41 PM (21 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
ecd23349865d588d280037e46df36f300536d5a2
Parents:
2499bf918092002632ace751f0bbae7bd5a2cccb
Message:
*hannes: faster conversions


git-svn-id: file:///usr/local/Singular/svn/trunk@6895 2c84dea3-7e68-4137-9b89-c4e89433aadc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • factory/NTLconvert.cc

    r2499bf rd07137  
    1 /* $Id: NTLconvert.cc,v 1.11 2003-08-28 11:54:31 Singular Exp $ */
     1/* $Id: NTLconvert.cc,v 1.12 2003-10-15 17:19:38 Singular Exp $ */
    22#include <config.h>
    33
     
    453453  char dummy[2];
    454454  int minusremainder=0;
     455  char numbers[]="0123456789abcdef";
    455456
    456457  coeff_long=to_long(coefficient);
     
    479480
    480481    int l=0;
    481     while (coefficient>9)
     482    while (coefficient>15)
    482483    {
    483484      ZZ quotient,remaind;
    484       ZZ ten;ten=10;
     485      ZZ ten;ten=16;
    485486      DivRem(quotient,remaind,coefficient,ten);
    486       dummy[0]=(char)(to_long(remaind)+'0');
     487      dummy[0]=numbers[to_long(remaind)];
    487488      //tmp*=10; tmp+=to_long(remaind);
    488489
     
    505506    }
    506507    //built up the string in dummy[0]
    507     dummy[0]=(char)(to_long(coefficient)+'0');
     508    dummy[0]=numbers[to_long(coefficient)];
    508509    strcat(cf_stringtemp,dummy);
    509510    //tmp*=10; tmp+=to_long(coefficient);
     
    526527
    527528  //convert the string to canonicalform using the char*-Constructor
    528   return CanonicalForm(cf_stringtemp2);
     529  return CanonicalForm(cf_stringtemp2,16);
    529530  //return tmp;
    530531}
Note: See TracChangeset for help on using the changeset viewer.