Changeset a4c74f in git


Ignore:
Timestamp:
Jul 16, 1999, 6:07:22 PM (24 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'spielwiese', '0d6b7fcd9813a1ca1ed4220cfa2b104b97a0a003')
Children:
86050ee275fe1a82d0ab4c97fb6fa4560231a142
Parents:
cedc3f5ddbba05d8f7f30511c0afe931d1b91fd5
Message:
* hanens: optimized int-reading


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

Legend:

Unmodified
Added
Removed
  • Singular/febase.cc

    rcedc3f ra4c74f  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: febase.cc,v 1.74 1999-07-06 15:32:43 Singular Exp $ */
     4/* $Id: febase.cc,v 1.75 1999-07-16 16:07:17 Singular Exp $ */
    55/*
    66* ABSTRACT: i/o system
     
    11941194      *i += *s++ - '0';
    11951195      l++;
    1196       if ((l>MAX_INT_LEN)||((*i) <0))
     1196      if ((l>=MAX_INT_LEN)||((*i) <0))
    11971197      {
    11981198        s-=l;
    11991199        Werror("`%s` greater than %d(max. integer representation)",
    1200                 s,INT_MAX);
     1200                s,MAX_INT_VAL);
    12011201        return s;
    12021202      }
  • Singular/ffields.cc

    rcedc3f ra4c74f  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: ffields.cc,v 1.19 1999-05-10 15:10:48 Singular Exp $ */
     4/* $Id: ffields.cc,v 1.20 1999-07-16 16:07:18 Singular Exp $ */
    55/*
    66* ABSTRACT: finite fields with a none-prime number of elements (via tables)
     
    487487      *i *= 10;
    488488      *i += *s++ - '0';
    489       if (*i > (INT_MAX / 10)) *i = *i % nfCharP;
     489      if (*i > (MAX_INT_VAL / 10)) *i = *i % nfCharP;
    490490    }
    491491    while (*s >= '0' && *s <= '9');
  • Singular/grammar.y

    rcedc3f ra4c74f  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: grammar.y,v 1.63 1999-07-14 13:16:00 Singular Exp $ */
     4/* $Id: grammar.y,v 1.64 1999-07-16 16:07:19 Singular Exp $ */
    55/*
    66* ABSTRACT: SINGULAR shell grammatik
     
    506506            if (l >= MAX_INT_LEN)
    507507            {
    508               char tmp[100];
     508              char tmp[MAX_INT_LEN+5];
    509509              sprintf(tmp,"%d",i);
    510510              if (strcmp(tmp,$1)!=0)
     
    513513                {
    514514                  Werror("`%s` greater than %d(max. integer representation)"
    515                          ,$1,INT_MAX);
     515                         ,$1,MAX_INT_VAL);
    516516                  YYERROR;
    517517                }
  • Singular/modulop.cc

    rcedc3f ra4c74f  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: modulop.cc,v 1.10 1999-05-10 15:10:50 Singular Exp $ */
     4/* $Id: modulop.cc,v 1.11 1999-07-16 16:07:20 Singular Exp $ */
    55/*
    66* ABSTRACT: numbers modulo p (<=32003)
     
    175175      (*i) *= 10;
    176176      (*i) += *s++ - '0';
    177       if ((*i) >= (INT_MAX / 10)) (*i) = (*i) % npPrimeM;
     177      if ((*i) >= (MAX_INT_VAL / 10)) (*i) = (*i) % npPrimeM;
    178178    }
    179179    while (((*s) >= '0') && ((*s) <= '9'));
  • Singular/scanner.l

    rcedc3f ra4c74f  
    33*  Computer Algebra System SINGULAR     *
    44****************************************/
    5 /* $Id: scanner.l,v 1.18 1999-07-09 14:58:29 Singular Exp $ */
     5/* $Id: scanner.l,v 1.19 1999-07-16 16:07:21 Singular Exp $ */
    66#include <stdio.h>
    77#include <string.h>
     
    257257{integer}                {
    258258                           lvalp->name = (char *)yytext;
    259                            if ((currRing!=NULL)
    260                            && (strlen(lvalp->name)>MAX_INT_LEN))
    261                            {
    262                              lvalp->name = mstrdup((char *)yytext);
    263                              return RINGVAR;
    264                            }
    265                            else
    266                              return INT_CONST;
     259                           return INT_CONST;
    267260                         }
    268261{integer}\/{integer}     {
  • Singular/shortfl.cc

    rcedc3f ra4c74f  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: shortfl.cc,v 1.9 1999-06-28 16:06:31 Singular Exp $ */
     4/* $Id: shortfl.cc,v 1.10 1999-07-16 16:07:21 Singular Exp $ */
    55
    66/*
     
    5555  int i;
    5656  float r = nf(n).F();
    57   if (((float)INT_MIN <= r) || ((float)INT_MAX >= r))
     57  if (((float)INT_MIN <= r) || ((float)MAX_INT_VAL >= r))
    5858    i = (int)r;
    5959  else
  • Singular/syz1.cc

    rcedc3f ra4c74f  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: syz1.cc,v 1.37 1999-06-07 15:46:02 obachman Exp $ */
     4/* $Id: syz1.cc,v 1.38 1999-07-16 16:07:22 Singular Exp $ */
    55/*
    66* ABSTRACT: resolutions
     
    303303  {
    304304    i=1;
    305     j = -INT_MAX;
     305    j = -MAX_INT_VAL;
    306306    int *ip=binomials+pGetExp(p,1);
    307307    loop
     
    607607#endif
    608608{
    609   int i2=-INT_MAX;
     609  int i2=-MAX_INT_VAL;
    610610  int i1;
    611611  int j;
     
    659659          pAddExp(tm2,1, pGetExp(m,1));
    660660          int *ip=binomials+pGetExp(tm2,1);
    661           i2=-INT_MAX;
     661          i2=-MAX_INT_VAL;
    662662          loop
    663663          {
     
    737737            pAddExp(tm2,1, pGetExp(m,1));
    738738            int *ip=binomials+pGetExp(tm2,1);
    739             i2=-INT_MAX;
     739            i2=-MAX_INT_VAL;
    740740            loop
    741741            {
     
    27812781{
    27822782#ifdef __MWERKS__
    2783   const double m=(double)INT_MAX;
     2783  const double m=(double)MAX_INT_VAL;
    27842784  double t=1.0;
    27852785  unsigned int h_d=1;
     
    27982798  long long t=1, h_d=1;
    27992799  long long h_n=1+pVariables;
    2800   while ((t=((t*h_n)/h_d))<INT_MAX)
     2800  while ((t=((t*h_n)/h_d))<MAX_INT_VAL)
    28012801  {
    28022802    h_d++;
Note: See TracChangeset for help on using the changeset viewer.