Changeset 2082b6 in git for Singular/gnumpfl.cc
 Timestamp:
 Jul 8, 1999, 6:44:03 PM (24 years ago)
 Branches:
 (u'spielwiese', '8e0ad00ce244dfd0756200662572aef8402f13d5')
 Children:
 58ce10a42ffe9e3efdfe86dbd440815c71d053d9
 Parents:
 b719a30005f8bcbcca9d638b7908dda038ffee56
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

Singular/gnumpfl.cc
rb719a3 r2082b6 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: gnumpfl.cc,v 1. 7 19990702 16:14:39 wenkExp $ */4 /* $Id: gnumpfl.cc,v 1.8 19990708 16:44:03 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT: computations with GMP floatingpoint numbers … … 241 241 { 242 242 if ( exp == 0 ) 243 { 243 { 244 244 gmp_float* n = new gmp_float(1); 245 *u=(number)n; 245 *u=(number)n; 246 246 return; 247 247 } … … 258 258 gmp_float* n = new gmp_float(); 259 259 *n= *(gmp_float*)x; 260 *u=(number)n; 260 *u=(number)n; 261 261 } 262 262 return; … … 389 389 else 390 390 { 391 if ( *s == '/' ) { 391 gmp_float divisor(1.0); 392 char *start2=s; 393 if ( *s == '/' ) 394 { 395 s++; 396 s= ngfEatFloatNExp( s ); 397 if (s!= start2+1) 398 { 399 char tmp_c=*s; 400 *s='\0'; 401 divisor.setFromStr(start2+1); 402 *s=tmp_c; 403 } 404 else 405 { 406 Werror("wrong long real format: %s",start2); 407 } 392 408 } 393 char c=*s ;394 *s ='\0';409 char c=*start2; 410 *start2='\0'; 395 411 if ( *(gmp_float**)a == NULL ) (*(gmp_float**)a)= new gmp_float(); 396 412 (*(gmp_float**)a)>setFromStr(start); 397 *s=c; 398 } 399 400 413 *start2=c; 414 (**(gmp_float**)a) /= divisor; 415 } 401 416 402 417 return s; … … 409 424 { 410 425 char *out; 411 if ( a ) { 426 if ( a != NULL ) 427 { 412 428 out= floatToStr(*(gmp_float*)a,gmp_output_digits); 413 429 StringAppend(out); 414 430 //Free((ADDRESS)out, (strlen(out)+1)* sizeof(char) ); 415 431 FreeL( (ADDRESS)out ); 416 } else { 432 } 433 else 434 { 417 435 StringAppend("0"); 418 436 }
Note: See TracChangeset
for help on using the changeset viewer.