Project

General

Profile

Bug #74

printing polynomials

Added by Anna Maria Bigatti over 12 years ago. Updated almost 10 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Various
Target version:
Start date:
22 Dec 2011
Due date:
% Done:

10%

Estimated time:
5.00 h

Description

/**/ K ::= QQ[a,b];   R := NewFractionField(K);   Use R[x];
/**/ x^2 - (1/(a))*x + 1;
prints as
x^2 +(-1/a)*x +1
Does this look bad? Some considerations:
  • The original rule for writing polynomials was:
    "when the coefficient ring is not ZZ or QQ the coefficients are all printed within brackets", e.g.
    (1)*x^2 +(-1/a)*x +(1)
    
  • Then I had to agree that so many "(1)*" and "(-1)*" looked quite heavy and I modified it:
    "when coefficients-fractions are not in QQ they are printed within brackets", e.g.
    a*x^2 +(-2/a)*x -3/5
    

I'm undecided whether "x^2 -(1/a)*x +1" is really better than "x^2 +(-1/a)*x +1" (especially considering how tedious it is to describe and implement this case...)

Any opinion? Examples to be considered?


Related issues

Related to CoCoALib - Feature #222: Printing polynomials - spaces between termsIn Progress2012-08-08

Related to CoCoALib - Feature #1117: Better printing of negative coeffsIn Progress2017-11-07

Related to CoCoALib - Design #1156: Printing for RingElemNew2018-02-12

History

#1 Updated by Anna Maria Bigatti about 10 years ago

  • Target version set to CoCoALib-0.99533 Easter14

#2 Updated by John Abbott about 10 years ago

  • Target version changed from CoCoALib-0.99533 Easter14 to CoCoALib-0.99534 Seoul14

#3 Updated by Anna Maria Bigatti almost 10 years ago

  • Target version changed from CoCoALib-0.99534 Seoul14 to CoCoALib-1.0

#4 Updated by John Abbott over 6 years ago

  • Related to Feature #1117: Better printing of negative coeffs added

#5 Updated by John Abbott about 6 years ago

Also available in: Atom PDF