Changeset d5564f8 in git for Singular/iparith.cc


Ignore:
Timestamp:
Jul 10, 2009, 5:15:16 PM (15 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'd25190065115c859833252500a64cfb7b11e3a50')
Children:
a9ca4ab64e5d10dd0a5613e146923d5b5c027a1b
Parents:
f0edfeefcdd0f9c131187bc82a9af8d0cb7c40df
Message:
*hannes: expoent overflow stuff


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

Legend:

Unmodified
Added
Removed
  • Singular/iparith.cc

    rf0edfee rd5564f8  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: iparith.cc,v 1.509 2009-07-08 15:26:02 Singular Exp $ */
     4/* $Id: iparith.cc,v 1.510 2009-07-10 15:14:35 Singular Exp $ */
    55
    66/*
     
    735735static BOOLEAN jjPOWER_P(leftv res, leftv u, leftv v)
    736736{
    737   res->data = (char *)pPower((poly)u->CopyD(POLY_CMD),(int)(long)v->Data());
     737  int v_i=(int)(long)v->Data();
     738  poly u_p=(poly)u->CopyD(POLY_CMD);
     739  int dummy;
     740  if ((u_p!=NULL)
     741  && (pLDeg(u_p,&dummy,currRing)*(signed long)v_i >= (signed long)currRing->bitmask))
     742  {
     743    pDelete(&u_p);
     744    Werror("OVERFLOW");
     745    return TRUE;
     746  }
     747  res->data = (char *)pPower(u_p,v_i);
    738748  if (u!=NULL) return jjOP_REST(res,u,v);
    739749  return errorreported; /* pPower may set errorreported via Werror */
     
    10161026  poly a;
    10171027  poly b;
     1028  int dummy;
    10181029  if (v->next==NULL)
    10191030  {
     
    10221033    {
    10231034      b=(poly)v->CopyD(POLY_CMD); // works also for VECTOR_CMD
     1035      #if 0
     1036      if ((a!=NULL) && (b!=NULL)
     1037      && (pLDeg(a,&dummy,currRing)+pLDeg(b,&dummy,currRing)>=currRing->bitmask))
     1038      {
     1039        pDelete(&a);
     1040        pDelete(&b);
     1041        WerrorS("OVERFLOW");
     1042        return TRUE;
     1043      }
     1044      #endif
    10241045      res->data = (char *)(pMult( a, b));
    10251046      pNormalize((poly)res->data);
     
    10281049    // u->next exists: copy v
    10291050    b=pCopy((poly)v->Data());
     1051    #if 0
     1052    if ((a!=NULL) && (b!=NULL)
     1053    && (pLDeg(a,&dummy,currRing)+pLDeg(b,&dummy,currRing)>=currRing->bitmask))
     1054    {
     1055      pDelete(&a);
     1056      pDelete(&b);
     1057      WerrorS("OVERFLOW");
     1058      return TRUE;
     1059    }
     1060    #endif
    10301061    res->data = (char *)(pMult( a, b));
    10311062    pNormalize((poly)res->data);
     
    10351066  a=pCopy((poly)u->Data());
    10361067  b=(poly)v->CopyD(POLY_CMD); // works also for VECTOR_CMD
     1068  #if 0
     1069  if ((a!=NULL) && (b!=NULL)
     1070  && (pLDeg(a,&dummy,currRing)+pLDeg(b,&dummy,currRing)>=currRing->bitmask))
     1071  {
     1072    pDelete(&a);
     1073    pDelete(&b);
     1074    WerrorS("OVERFLOW");
     1075    return TRUE;
     1076  }
     1077  #endif
    10371078  res->data = (char *)(pMult( a, b));
    10381079  pNormalize((poly)res->data);
Note: See TracChangeset for help on using the changeset viewer.