Changeset 3a143d in git
- Timestamp:
- Jul 2, 1999, 4:28:53 PM (24 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
- Children:
- 1ce62fa5979699f05bc8ccbc453b8bfdafd92c1c
- Parents:
- 5ec0264649e3318cb84ecd5ffd7c5a2296539b5a
- Location:
- Singular
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/gnumpc.cc
r5ec0264 r3a143d 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: gnumpc.cc,v 1. 3 1999-06-29 09:03:42 wenkExp $ */4 /* $Id: gnumpc.cc,v 1.4 1999-07-02 14:28:51 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT: computations with GMP complex floating-point numbers … … 74 74 void ngcNew (number * r) 75 75 { 76 *r= NULL; 76 gmp_complex* n= new gmp_complex( ); 77 *r=(number)n; 77 78 } 78 79 … … 250 251 if ( exp == 0 ) 251 252 { 252 *(gmp_complex*)u= (gmp_complex)1.0; 253 gmp_complex* n = new gmp_complex(1); 254 *u=(number)n; 253 255 return; 254 256 } 255 257 if ( exp == 1 ) 256 258 { 259 nNew(u); 257 260 if ( x == NULL ) 258 261 { 259 *(gmp_complex*)u= (gmp_complex)0.0; 262 gmp_complex* n = new gmp_complex(); 263 *u=(number)n; 260 264 } 261 265 else 262 266 { 263 *(gmp_complex*)u= *(gmp_complex*)x; 267 gmp_complex* n = new gmp_complex(); 268 *n= *(gmp_complex*)x; 269 *u=(number)n; 264 270 } 265 271 return; 266 272 } 267 273 ngcPower(x,exp-1,u); 268 *(gmp_complex*)u*= *(gmp_complex*)x; 274 gmp_complex *n=new gmp_complex(); 275 *n=*(gmp_complex*)x; 276 *(gmp_complex*)(*u) *= *(gmp_complex*)n; 277 delete n; 269 278 } 270 279 -
Singular/gnumpfl.cc
r5ec0264 r3a143d 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: gnumpfl.cc,v 1. 4 1999-06-23 08:26:43 wenkExp $ */4 /* $Id: gnumpfl.cc,v 1.5 1999-07-02 14:28:52 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT: computations with GMP floating-point numbers … … 241 241 { 242 242 if ( exp == 0 ) 243 { 243 { 244 nNew(u); 244 245 *(gmp_float*)u= (gmp_float)1.0; 245 246 return; … … 247 248 if ( exp == 1 ) 248 249 { 250 nNew(u); 249 251 if ( x == NULL ) 250 252 { -
Singular/mpr_complex.cc
r5ec0264 r3a143d 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: mpr_complex.cc,v 1. 8 1999-06-28 16:06:26Singular Exp $ */4 /* $Id: mpr_complex.cc,v 1.9 1999-07-02 14:28:53 Singular Exp $ */ 5 5 6 6 /* … … 509 509 if (rField_is_long_C()) 510 510 { 511 out=(char*)AllocL((strlen(in_real)+strlen(in_imag)+5+strlen(currRing->parameter[0]))*sizeof(char)); 511 int len=(strlen(in_real)+strlen(in_imag)+5+strlen(currRing->parameter[0]))*sizeof(char); 512 out=(char*)AllocL(len); 513 memset(out,0,len); 512 514 sprintf(out,"%s%s%s*%s",in_real,c.imag().sign()>=0?"+":"-",currRing->parameter[0],in_imag); 513 515 } 514 516 else 515 517 { 516 out=(char*)AllocL( (strlen(in_real)+strlen(in_imag)+8) * sizeof(char)); 518 int len=(strlen(in_real)+strlen(in_imag)+8) * sizeof(char); 519 out=(char*)AllocL( len ); 520 memset(out,0,len); 517 521 sprintf(out,"%s%s%s",in_real,c.imag().sign()>=0?" + I ":" - I ",in_imag); 518 522 }
Note: See TracChangeset
for help on using the changeset viewer.