Changeset 0d84792 in git


Ignore:
Timestamp:
Jan 22, 1999, 7:23:21 PM (25 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'spielwiese', '8e0ad00ce244dfd0756200662572aef8402f13d5')
Children:
8e012379f6186bcc208b49f8710913df381eb5e3
Parents:
31b8436f979efbf98c360c7279f6ef542bf0c26f
Message:
*hannes: fixed poly->any conversion


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

Legend:

Unmodified
Added
Removed
  • Singular/ipconv.cc

    r31b843 r0d84792  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: ipconv.cc,v 1.15 1998-11-12 14:44:37 siebert Exp $ */
     4/* $Id: ipconv.cc,v 1.16 1999-01-22 18:23:21 Singular Exp $ */
    55/*
    66* ABSTRACT: automatic type conversions
     
    153153  //{
    154154  //  nDelete((number *)&data);
    155   //} 
     155  //}
    156156  return (void *)p;
    157157}
     
    169169  //{
    170170  //  nDelete((number *)&data);
    171   //} 
     171  //}
    172172  return (void *)I;
    173173}
     
    290290      else if ((input->rtyp==POLY_CMD) && (input->name==NULL))
    291291      {
    292         int nr=pIsPurePower((poly)input->data);
    293         if (nr!=0)
     292        if (input->data!=NULL)
    294293        {
    295           if (pGetExp((poly)input->data,nr)==1)
     294          int nr=pIsPurePower((poly)input->data);
     295          if (nr!=0)
    296296          {
    297             output->name=mstrdup(currRing->names[nr-1]);
     297            if (pGetExp((poly)input->data,nr)==1)
     298            {
     299              output->name=mstrdup(currRing->names[nr-1]);
     300            }
     301            else
     302            {
     303              output->name=(char *)AllocL(4);
     304              sprintf(output->name,"%c%d",*(currRing->names[nr-1]),
     305              pGetExp((poly)input->data,nr));
     306            }
    298307          }
     308          else if(pIsConstant((poly)input->data))
     309          {
     310            output->name=nName(pGetCoeff((poly)input->data));
     311          }
     312#ifdef TEST
    299313          else
    300314          {
    301             output->name=(char *)AllocL(4);
    302             sprintf(output->name,"%c%d",*(currRing->names[nr-1]),
    303               pGetExp((poly)input->data,nr));
     315            WerrorS("wrong name, should not happen");
     316            output->name=mstrdup("?");
    304317          }
     318#endif
    305319        }
    306         else if(pIsConstant((poly)input->data))
    307         {
    308           output->name=nName(pGetCoeff((poly)input->data));
    309         }
    310 #ifdef TEST
    311         else
    312         {
    313           WerrorS("wrong name, should not happen");
    314           output->name=mstrdup("?");
    315         }
    316 #endif
    317320      }
    318321      else if ((input->rtyp==NUMBER_CMD) && (input->name==NULL))
Note: See TracChangeset for help on using the changeset viewer.