string(polynomial) yields 1x^n instead of x^n (and a+[] WARNING). Patch provided
@sgougeon)
Reported by Samuel GOUGEON (%p_string.sci (3.15 KB, text/plain)
SCI/modules/overloading/macros/%p_string.sci fixed
BUG DESCRIPTION:
----------------
Unlike their display in console and from sci2exp(), string() keeps coefficients equal to +1 or -1 before x^n (n>0):
--> x = poly(0,"x");
--> e = -1 + x - 2*x^2 - x^3
e =
2 3
- 1 + x - 2x - x
-->sci2exp(e)
ans =
-1+x-2*x^2-x^3
--> string(e)
ans =
! 2 3 !
! !
! - 1 + 1x - 2x - 1x ! <<< 1x should be x ; 1x^3 should be x^3
// WITH THE PATCH:
--> string(e)
ans =
! 2 3 !
! !
! - 1 + x - 2x - x !
ERROR LOG:
----------
None. Sub-optimal formating
HOW TO REPRODUCE THE BUG:
-------------------------
x = poly(0,"x");
e = -1 + x - 2*x^2 - x^3
string(e)
sci2exp(e)
OTHER INFORMATION:
------------------