Changeset a5071b9 in git


Ignore:
Timestamp:
Sep 26, 2011, 5:38:26 PM (13 years ago)
Author:
Burcin Erocal <burcin@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', '98550b669234b32be762076c32b3be2c35188ac4')
Children:
a195edd4d149b8454ad5aea3c914d9bf579f93b4
Parents:
4eb485635d45ce52dc829f85b42fe078e603df55
git-author:
Burcin Erocal <burcin@erocal.org>2011-09-26 17:38:26+02:00
git-committer:
Mohamed Barakat <mohamed.barakat@rwth-aachen.de>2011-11-09 16:13:33+01:00
Message:
Fix printing of coefficients in transcendental extensions.

The new logic, taken from legacy Singular for compatibility in test
output, is to omit parenthesis around the denominator and the
numerator if the denominator is 1 and the numerator is a constant.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libpolys/polys/ext_fields/transext.cc

    r4eb485 ra5071b9  
    829829  {
    830830    fraction f = (fraction)a;
    831     BOOLEAN useBrackets = (!p_IsConstant(NUM(f), ntRing)) ||
    832                           (!n_GreaterZero(p_GetCoeff(NUM(f), ntRing),
    833                                           ntCoeffs));
    834     if (useBrackets) StringAppendS("(");
     831    // stole logic from napWrite from kernel/longtrans.cc of legacy singular
     832    BOOLEAN omitBrackets = p_IsConstant(NUM(f), ntRing) && DENIS1(f);
     833    if (!omitBrackets) StringAppendS("(");
    835834    p_String0(NUM(f), ntRing, ntRing);
    836     if (useBrackets) StringAppendS(")");
     835    if (!omitBrackets) StringAppendS(")");
    837836    if (!DENIS1(f))
    838837    {
    839838      StringAppendS("/");
    840       useBrackets = (!p_IsConstant(DEN(f), ntRing)) ||
    841                     (!n_GreaterZero(p_GetCoeff(DEN(f), ntRing), ntCoeffs));
    842       if (useBrackets) StringAppendS("(");
     839      StringAppendS("(");
    843840      p_String0(DEN(f), ntRing, ntRing);
    844       if (useBrackets) StringAppendS(")");
     841      StringAppendS(")");
    845842    }
    846843  }
Note: See TracChangeset for help on using the changeset viewer.