Changeset b7e838 in git


Ignore:
Timestamp:
Jul 3, 2007, 4:45:57 PM (16 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'spielwiese', '0d6b7fcd9813a1ca1ed4220cfa2b104b97a0a003')
Children:
a3181c6c6f9d31d0bfc59b709eed83fcecba79c5
Parents:
0ea97ea490acc1915ccaedd3839aadce86cf48e1
Message:
*hannes: test division by 0


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

Legend:

Unmodified
Added
Removed
  • kernel/ffields.cc

    r0ea97e rb7e838  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: ffields.cc,v 1.3 2005-07-27 15:48:28 Singular Exp $ */
     4/* $Id: ffields.cc,v 1.4 2007-07-03 14:45:56 Singular Exp $ */
    55/*
    66* ABSTRACT: finite fields with a none-prime number of elements (via tables)
     
    317317  if ((long)b==(long)nfCharQ)
    318318  {
    319     WerrorS("div. by 0");
     319    WerrorS(nDivBy0);
    320320    return (number)((long)nfCharQ);
    321321  }
     
    345345  if ((long)c==(long)nfCharQ)
    346346  {
    347     WerrorS("div. 1/0");
     347    WerrorS(nDivBy0);
    348348    return (number)((long)nfCharQ);
    349349  }
  • kernel/gnumpc.cc

    r0ea97e rb7e838  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: gnumpc.cc,v 1.3 2005-05-18 15:39:19 Singular Exp $ */
     4/* $Id: gnumpc.cc,v 1.4 2007-07-03 14:45:56 Singular Exp $ */
    55/*
    66* ABSTRACT: computations with GMP complex floating-point numbers
     
    179179number ngcInvers(number a)
    180180{
    181   gmp_complex* r= NULL;
    182   if ( (a==NULL) /*|| ((gmp_complex*)a)->isZero()*/ )
    183   {
    184     WerrorS("div. 1/0");
     181  gmp_complex* r = NULL;
     182  if ( (a==NULL)
     183  || (((gmp_complex*)a)->isZero()))
     184  {
     185    WerrorS(nDivBy0);
    185186  }
    186187  else
     
    264265number ngcDiv (number a, number b)
    265266{
    266   if ( b==NULL /*|| ((gmp_float*)b)->isZero()*/ )
     267  if ( a==NULL )
     268  {
     269    // 0/b = 0
     270    return NULL;
     271  }
     272  else if (( b==NULL )
     273  || (((gmp_complex*)b)->isZero()))
    267274  {
    268275    // a/0 = error
    269     WerrorS("div. 1/0");
    270     return NULL;
    271   }
    272   else if ( a==NULL )
    273   {
    274     // 0/b = 0
     276    WerrorS(nDivBy0);
    275277    return NULL;
    276278  }
  • kernel/gnumpfl.cc

    r0ea97e rb7e838  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: gnumpfl.cc,v 1.2 2004-07-30 12:18:50 Singular Exp $ */
     4/* $Id: gnumpfl.cc,v 1.3 2007-07-03 14:45:56 Singular Exp $ */
    55/*
    66* ABSTRACT: computations with GMP floating-point numbers
     
    176176{
    177177  gmp_float* r= NULL;
    178   if ( (a==NULL) /*|| ((gmp_float*)a)->isZero()*/ )
    179   {
    180     WerrorS("div. 1/0");
     178  if ( (a==NULL) || ((gmp_float*)a)->isZero() )
     179  {
     180    WerrorS(nDivBy0);
    181181  }
    182182  else
     
    259259number ngfDiv (number a, number b)
    260260{
    261   if ( b==NULL /*|| ((gmp_float*)b)->isZero()*/ )
     261  if ( a==NULL )
     262  {
     263    // 0/b = 0
     264    return NULL;
     265  }
     266  else if ( b==NULL || ((gmp_float*)b)->isZero() )
    262267  {
    263268    // a/0 = error
    264     WerrorS("div. 1/0");
    265     return NULL;
    266   }
    267   else if ( a==NULL )
    268   {
    269     // 0/b = 0
     269    WerrorS(nDivBy0);
    270270    return NULL;
    271271  }
  • kernel/longalg.cc

    r0ea97e rb7e838  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: longalg.cc,v 1.27 2007-05-22 13:29:48 Singular Exp $ */
     4/* $Id: longalg.cc,v 1.28 2007-07-03 14:45:56 Singular Exp $ */
    55/*
    66* ABSTRACT:   algebraic numbers
     
    12321232  if (b==NULL)
    12331233  {
    1234     WerrorS("div. by 0");
     1234    WerrorS(nDivBy0);
    12351235    return NULL;
    12361236  }
     
    12651265  if ((b==NULL) || (b->z==NULL))
    12661266  {
    1267     WerrorS("div. by 0");
     1267    WerrorS(nDivBy0);
    12681268    return NULL;
    12691269  }
     
    13401340  if (b==NULL)
    13411341  {
    1342     WerrorS("div. by 0");
     1342    WerrorS(nDivBy0);
    13431343    return NULL;
    13441344  }
  • kernel/longrat.cc

    r0ea97e rb7e838  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: longrat.cc,v 1.17 2007-04-19 14:17:58 Singular Exp $ */
     4/* $Id: longrat.cc,v 1.18 2007-07-03 14:45:56 Singular Exp $ */
    55/*
    66* ABSTRACT: computation with long rational numbers (Hubert Grassmann)
     
    456456    if (nlIsZero(a))
    457457    {
    458       WerrorS("div. 1/0");
     458      WerrorS(nDivBy0);
    459459      return INT_TO_SR(0);
    460460    }
     
    544544  if (b==INT_TO_SR(0))
    545545  {
    546     WerrorS("div. by 0");
     546    WerrorS(nDivBy0);
    547547    return INT_TO_SR(0);
    548548  }
     
    610610  if (b==INT_TO_SR(0))
    611611  {
    612     WerrorS("div. by 0");
     612    WerrorS(nDivBy0);
    613613    return INT_TO_SR(0);
    614614  }
     
    691691  if (b==INT_TO_SR(0))
    692692  {
    693     WerrorS("div. by 0");
     693    WerrorS(nDivBy0);
    694694    return INT_TO_SR(0);
    695695  }
     
    791791  if (nlIsZero(b))
    792792  {
    793     WerrorS("div. by 0");
     793    WerrorS(nDivBy0);
    794794    return INT_TO_SR(0);
    795795  }
  • kernel/modulop.cc

    r0ea97e rb7e838  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: modulop.cc,v 1.8 2007-01-15 17:12:09 Singular Exp $ */
     4/* $Id: modulop.cc,v 1.9 2007-07-03 14:45:56 Singular Exp $ */
    55/*
    66* ABSTRACT: numbers modulo p (<=32003)
     
    172172  if ((long)b==0)
    173173  {
    174     WerrorS("div by 0");
     174    WerrorS(nDivBy0);
    175175    return (number)0;
    176176  }
     
    564564  else if ((long)b==0)
    565565  {
    566     WerrorS("div by 0");
     566    WerrorS(nDivBy0);
    567567    return (number)0;
    568568  }
     
    577577  if ((long)c==0)
    578578  {
    579     WerrorS("1/0");
     579    WerrorS(nDivBy0);
    580580    return (number)0;
    581581  }
  • kernel/mpr_complex.h

    r0ea97e rb7e838  
    44*  Computer Algebra System SINGULAR     *
    55****************************************/
    6 /* $Id: mpr_complex.h,v 1.4 2004-07-30 12:18:50 Singular Exp $ */
     6/* $Id: mpr_complex.h,v 1.5 2007-07-03 14:45:57 Singular Exp $ */
    77
    88/*
     
    117117  inline int sign()    // t>0:+1, t==0:0, t<0:-1
    118118  { return mpf_sgn( t ); };
    119  
     119
    120120  bool isZero();  // t == 0 ?
    121121  bool isOne();   // t == 1 ?
     
    127127  inline const mpf_t *mpfp() const { return &t; };
    128128  inline mpf_t *_mpfp() { return &t; };
    129  
     129
    130130  inline operator double() { return mpf_get_d( t ); };
    131131  inline operator double() const { return mpf_get_d( t ); };
     
    140140    return 0;
    141141  };
    142 #endif 
     142#endif
    143143
    144144private:
     
    226226  inline void imag( gmp_float val ) { i = val; }
    227227
     228
     229  inline bool isZero() { return (r.isZero() && i.isZero()); }
    228230  void SmallToZero();
    229231};
  • kernel/numbers.cc

    r0ea97e rb7e838  
    22*  Computer Algebra System SINGULAR      *
    33*****************************************/
    4 /* $Id: numbers.cc,v 1.10 2007-06-20 09:39:24 wienand Exp $ */
     4/* $Id: numbers.cc,v 1.11 2007-07-03 14:45:57 Singular Exp $ */
    55
    66/*
     
    7272/*0 implementation*/
    7373number nNULL; /* the 0 as constant */
    74 
    7574
    7675n_Procs_s *cf_root=NULL;
  • kernel/numbers.h

    r0ea97e rb7e838  
    44*  Computer Algebra System SINGULAR     *
    55****************************************/
    6 /* $Id: numbers.h,v 1.9 2007-06-20 09:39:24 wienand Exp $ */
     6/* $Id: numbers.h,v 1.10 2007-07-03 14:45:57 Singular Exp $ */
    77/*
    88* ABSTRACT: interface to coefficient aritmetics
     
    101101void nSetChar(ring r);
    102102
     103#define nDivBy0 "div by 0"
    103104#endif
  • kernel/shortfl.cc

    r0ea97e rb7e838  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: shortfl.cc,v 1.2 2005-07-27 15:48:29 Singular Exp $ */
     4/* $Id: shortfl.cc,v 1.3 2007-07-03 14:45:57 Singular Exp $ */
    55
    66/*
     
    152152  if (n == 0.0)
    153153  {
    154     WerrorS("a/0");
     154    WerrorS(nDivBy0);
    155155    return nf((float)0.0).N();
    156156  }
     
    164164  if (n == 0.0)
    165165  {
    166     WerrorS("1/0");
     166    WerrorS(nDivBy0);
    167167    return nf((float)0.0).N();
    168168  }
Note: See TracChangeset for help on using the changeset viewer.