Design #432
Semantics of IsPrintedWithMinus
Description
We should clarify what the semantics of IsPrintedWithMinus
are.
I suggest that if IsPrintedWithMinus(x)
gives true
then IsPrintedWithMinus(-x)
must give false; note that x
and -x
could both give false
e.g. if using least non neg residue for a prime finite field.
Related issues
History
#1 Updated by John Abbott over 10 years ago
- Status changed from New to In Progress
If we follow the suggestion in note 6 of issue #222 then we need to define IsPrintedWithMinus
only for numerical ringelems (i.e. ones for which IsRational
gives true). If so, then there is an easy definition:
bool IsPrintedWithMinus(ConstRefRingElem x) { BigRat q; return IsRational(q, x) && sign(q) == -1; }
#2 Updated by John Abbott over 10 years ago
Anna rightly asked how should TwinFloats be handled.
Right now, I'm undecided. I'm quite sure that any polynomial with twinfloat coeffs will be very ugly/unreadable when printed.
#3 Updated by John Abbott almost 10 years ago
- Target version set to CoCoALib-1.0
- % Done changed from 0 to 10
If we use the definition I gave in comment 1 then some twin-float numbers will be recognized as rationals and should be printed out as such (I suppose). It could look a bit odd having a poly whose coeffs are partly rational and partly "floating-point"; then again a rational coeff is probably important information (since I'd expect it to be a rare event).
#4 Updated by John Abbott over 6 years ago
- Related to Feature #1117: Better printing of negative coeffs added
#5 Updated by John Abbott over 6 years ago
- Related to Design #1156: Printing for RingElem added