Changeset 5fe545 in git
- Timestamp:
- May 18, 2005, 5:39:19 PM (19 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- b340969c053d9f828187f38bac97b1feb96e654e
- Parents:
- 7835d2ba9bdd252cdfa90863a2ff862d818f9ac1
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/gnumpc.cc
r7835d2b r5fe545 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: gnumpc.cc,v 1. 2 2005-01-18 08:53:45Singular Exp $ */4 /* $Id: gnumpc.cc,v 1.3 2005-05-18 15:39:19 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT: computations with GMP complex floating-point numbers … … 290 290 return; 291 291 } 292 if ( exp == 1 )292 else if ( exp == 1 ) 293 293 { 294 294 nNew(u); … … 306 306 return; 307 307 } 308 ngcPower(x,exp-1,u); 309 gmp_complex *n=new gmp_complex(); 310 *n=*(gmp_complex*)x; 311 *(gmp_complex*)(*u) *= *(gmp_complex*)n; 312 delete n; 308 else if (exp == 2) 309 { 310 nNew(u); 311 if ( x == NULL ) 312 { 313 gmp_complex* n = new gmp_complex(); 314 *u=(number)n; 315 } 316 else 317 { 318 gmp_complex* n = new gmp_complex(); 319 *n= *(gmp_complex*)x; 320 *u=(number)n; 321 *(gmp_complex*)(*u) *= *(gmp_complex*)n; 322 } 323 return; 324 } 325 if (exp&1==1) 326 { 327 ngcPower(x,exp-1,u); 328 gmp_complex *n=new gmp_complex(); 329 *n=*(gmp_complex*)x; 330 *(gmp_complex*)(*u) *= *(gmp_complex*)n; 331 delete n; 332 } 333 else 334 { 335 number w; 336 nNew(&w); 337 ngcPower(x,exp/2,&w); 338 ngcPower(w,2,u); 339 nDelete(&w); 340 } 313 341 } 314 342
Note: See TracChangeset
for help on using the changeset viewer.