Changeset 26ebc6 in git for libpolys/coeffs/shortfl.cc
- Timestamp:
- Feb 25, 2013, 12:37:51 PM (10 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'ad2543eab51733612ba7d118afc77edca719600e')
- Children:
- 27c79fcbc083eb57ec1345d22a6892cf162f017b
- Parents:
- 0c516e37d47da9dbc827d68d2253f7289dfbfd3c8c2815d19daf34708c2cbc2cf44f8a95b28e3a28
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libpolys/coeffs/shortfl.cc
r0c516e r26ebc6 6 6 * ABSTRACT: 7 7 */ 8 #include <iostream>9 8 #include <coeffs/shortfl.h> 10 9 … … 249 248 assume( getCoeffType(r) == ID ); 250 249 251 StringAppend("%9.3e", nf(a).F()); 250 char ch[11]; 251 int n = sprintf(ch,"%9.3e", nf(a).F()); 252 if (ch[0] == '-') 253 { 254 char* chbr = new char[n+3]; 255 memcpy(&chbr[2],&ch[1],n-1); 256 chbr[0] = '-'; 257 chbr[1] = '('; 258 chbr[n+1] = ')'; 259 chbr[n+2] = '\0'; 260 StringAppendS(chbr); 261 delete chbr; 262 } 263 else 264 StringAppend("(%s)",ch); 252 265 } 253 266 … … 436 449 signed long int exp; 437 450 basis = mpf_get_d_2exp(&exp, e); 438 float f =ldexp(basis,exp);451 float f= mpf_sgn(e)*ldexp(basis,exp); 439 452 mpf_clear(e); 440 453 return nf(f).N(); … … 462 475 signed long int exp; 463 476 basis = mpf_get_d_2exp(&exp, q); 464 float f = ldexp(basis,exp);477 float f = mpf_sgn(e)*ldexp(basis,exp); 465 478 mpf_clear(e); 466 479 mpf_clear(d);
Note: See TracChangeset
for help on using the changeset viewer.