Changeset 2ad754 in git for libpolys/coeffs/shortfl.cc


Ignore:
Timestamp:
Feb 21, 2013, 7:02:39 PM (10 years ago)
Author:
Yue Ren <ren@…>
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
Children:
8c2815d19daf34708c2cbc2cf44f8a95b28e3a28
Parents:
0c516e37d47da9dbc827d68d2253f7289dfbfd3c
git-author:
Yue Ren <ren@mathematik.uni-kl.de>2013-02-21 19:02:39+01:00
git-committer:
Yue Ren <ren@mathematik.uni-kl.de>2013-02-25 10:56:53+01:00
Message:
chg: added brackets around floating numbers

fixed latex lib and updated res files

for long coefficients.tst, note that
286391521141683198701331939250003266767738632875
/12103947791971846719838321886393392913750065060875
=0.02366...

and not

=24.12...

which was the previous result.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libpolys/coeffs/shortfl.cc

    r0c516e r2ad754  
    66* ABSTRACT:
    77*/
    8 #include <iostream>
    98#include <coeffs/shortfl.h>
    109
     
    249248  assume( getCoeffType(r) == ID );
    250249
    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);
    252265}
    253266
Note: See TracChangeset for help on using the changeset viewer.