Changeset b7e838 in git
- Timestamp:
- Jul 3, 2007, 4:45:57 PM (16 years ago)
- Branches:
- (u'spielwiese', '0d6b7fcd9813a1ca1ed4220cfa2b104b97a0a003')
- Children:
- a3181c6c6f9d31d0bfc59b709eed83fcecba79c5
- Parents:
- 0ea97ea490acc1915ccaedd3839aadce86cf48e1
- Location:
- kernel
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/ffields.cc
r0ea97e rb7e838 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: ffields.cc,v 1. 3 2005-07-27 15:48:28Singular Exp $ */4 /* $Id: ffields.cc,v 1.4 2007-07-03 14:45:56 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT: finite fields with a none-prime number of elements (via tables) … … 317 317 if ((long)b==(long)nfCharQ) 318 318 { 319 WerrorS( "div. by 0");319 WerrorS(nDivBy0); 320 320 return (number)((long)nfCharQ); 321 321 } … … 345 345 if ((long)c==(long)nfCharQ) 346 346 { 347 WerrorS( "div. 1/0");347 WerrorS(nDivBy0); 348 348 return (number)((long)nfCharQ); 349 349 } -
kernel/gnumpc.cc
r0ea97e rb7e838 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: gnumpc.cc,v 1. 3 2005-05-18 15:39:19Singular Exp $ */4 /* $Id: gnumpc.cc,v 1.4 2007-07-03 14:45:56 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT: computations with GMP complex floating-point numbers … … 179 179 number ngcInvers(number a) 180 180 { 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); 185 186 } 186 187 else … … 264 265 number ngcDiv (number a, number b) 265 266 { 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())) 267 274 { 268 275 // 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); 275 277 return NULL; 276 278 } -
kernel/gnumpfl.cc
r0ea97e rb7e838 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: gnumpfl.cc,v 1. 2 2004-07-30 12:18:50Singular Exp $ */4 /* $Id: gnumpfl.cc,v 1.3 2007-07-03 14:45:56 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT: computations with GMP floating-point numbers … … 176 176 { 177 177 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); 181 181 } 182 182 else … … 259 259 number ngfDiv (number a, number b) 260 260 { 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() ) 262 267 { 263 268 // 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); 270 270 return NULL; 271 271 } -
kernel/longalg.cc
r0ea97e rb7e838 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: longalg.cc,v 1.2 7 2007-05-22 13:29:48Singular Exp $ */4 /* $Id: longalg.cc,v 1.28 2007-07-03 14:45:56 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT: algebraic numbers … … 1232 1232 if (b==NULL) 1233 1233 { 1234 WerrorS( "div. by 0");1234 WerrorS(nDivBy0); 1235 1235 return NULL; 1236 1236 } … … 1265 1265 if ((b==NULL) || (b->z==NULL)) 1266 1266 { 1267 WerrorS( "div. by 0");1267 WerrorS(nDivBy0); 1268 1268 return NULL; 1269 1269 } … … 1340 1340 if (b==NULL) 1341 1341 { 1342 WerrorS( "div. by 0");1342 WerrorS(nDivBy0); 1343 1343 return NULL; 1344 1344 } -
kernel/longrat.cc
r0ea97e rb7e838 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: longrat.cc,v 1.1 7 2007-04-19 14:17:58Singular Exp $ */4 /* $Id: longrat.cc,v 1.18 2007-07-03 14:45:56 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT: computation with long rational numbers (Hubert Grassmann) … … 456 456 if (nlIsZero(a)) 457 457 { 458 WerrorS( "div. 1/0");458 WerrorS(nDivBy0); 459 459 return INT_TO_SR(0); 460 460 } … … 544 544 if (b==INT_TO_SR(0)) 545 545 { 546 WerrorS( "div. by 0");546 WerrorS(nDivBy0); 547 547 return INT_TO_SR(0); 548 548 } … … 610 610 if (b==INT_TO_SR(0)) 611 611 { 612 WerrorS( "div. by 0");612 WerrorS(nDivBy0); 613 613 return INT_TO_SR(0); 614 614 } … … 691 691 if (b==INT_TO_SR(0)) 692 692 { 693 WerrorS( "div. by 0");693 WerrorS(nDivBy0); 694 694 return INT_TO_SR(0); 695 695 } … … 791 791 if (nlIsZero(b)) 792 792 { 793 WerrorS( "div. by 0");793 WerrorS(nDivBy0); 794 794 return INT_TO_SR(0); 795 795 } -
kernel/modulop.cc
r0ea97e rb7e838 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: modulop.cc,v 1. 8 2007-01-15 17:12:09Singular Exp $ */4 /* $Id: modulop.cc,v 1.9 2007-07-03 14:45:56 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT: numbers modulo p (<=32003) … … 172 172 if ((long)b==0) 173 173 { 174 WerrorS( "div by 0");174 WerrorS(nDivBy0); 175 175 return (number)0; 176 176 } … … 564 564 else if ((long)b==0) 565 565 { 566 WerrorS( "div by 0");566 WerrorS(nDivBy0); 567 567 return (number)0; 568 568 } … … 577 577 if ((long)c==0) 578 578 { 579 WerrorS( "1/0");579 WerrorS(nDivBy0); 580 580 return (number)0; 581 581 } -
kernel/mpr_complex.h
r0ea97e rb7e838 4 4 * Computer Algebra System SINGULAR * 5 5 ****************************************/ 6 /* $Id: mpr_complex.h,v 1. 4 2004-07-30 12:18:50Singular Exp $ */6 /* $Id: mpr_complex.h,v 1.5 2007-07-03 14:45:57 Singular Exp $ */ 7 7 8 8 /* … … 117 117 inline int sign() // t>0:+1, t==0:0, t<0:-1 118 118 { return mpf_sgn( t ); }; 119 119 120 120 bool isZero(); // t == 0 ? 121 121 bool isOne(); // t == 1 ? … … 127 127 inline const mpf_t *mpfp() const { return &t; }; 128 128 inline mpf_t *_mpfp() { return &t; }; 129 129 130 130 inline operator double() { return mpf_get_d( t ); }; 131 131 inline operator double() const { return mpf_get_d( t ); }; … … 140 140 return 0; 141 141 }; 142 #endif 142 #endif 143 143 144 144 private: … … 226 226 inline void imag( gmp_float val ) { i = val; } 227 227 228 229 inline bool isZero() { return (r.isZero() && i.isZero()); } 228 230 void SmallToZero(); 229 231 }; -
kernel/numbers.cc
r0ea97e rb7e838 2 2 * Computer Algebra System SINGULAR * 3 3 *****************************************/ 4 /* $Id: numbers.cc,v 1.1 0 2007-06-20 09:39:24 wienandExp $ */4 /* $Id: numbers.cc,v 1.11 2007-07-03 14:45:57 Singular Exp $ */ 5 5 6 6 /* … … 72 72 /*0 implementation*/ 73 73 number nNULL; /* the 0 as constant */ 74 75 74 76 75 n_Procs_s *cf_root=NULL; -
kernel/numbers.h
r0ea97e rb7e838 4 4 * Computer Algebra System SINGULAR * 5 5 ****************************************/ 6 /* $Id: numbers.h,v 1. 9 2007-06-20 09:39:24 wienandExp $ */6 /* $Id: numbers.h,v 1.10 2007-07-03 14:45:57 Singular Exp $ */ 7 7 /* 8 8 * ABSTRACT: interface to coefficient aritmetics … … 101 101 void nSetChar(ring r); 102 102 103 #define nDivBy0 "div by 0" 103 104 #endif -
kernel/shortfl.cc
r0ea97e rb7e838 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: shortfl.cc,v 1. 2 2005-07-27 15:48:29Singular Exp $ */4 /* $Id: shortfl.cc,v 1.3 2007-07-03 14:45:57 Singular Exp $ */ 5 5 6 6 /* … … 152 152 if (n == 0.0) 153 153 { 154 WerrorS( "a/0");154 WerrorS(nDivBy0); 155 155 return nf((float)0.0).N(); 156 156 } … … 164 164 if (n == 0.0) 165 165 { 166 WerrorS( "1/0");166 WerrorS(nDivBy0); 167 167 return nf((float)0.0).N(); 168 168 }
Note: See TracChangeset
for help on using the changeset viewer.