prettyprint() wrong output with NaN. "+" should be omitted for exponents >0. Too much space around \time
Reported by Samuel GOUGEON (@sgougeon)
BUG DESCRIPTION:
----------------
1) prettyprint() may gives a wrong output with NaN:
--> r = prettyprint(complex(1,%nan))
r =
$1{\mathrm{NaN}}i$
instead of $1+{\mathrm{NaN}}i$ // "+" is missing
2) Positive exponents are converted with their signs. This takes some room without adding any information.
IMO, it should be omitted, as it already is for the mantissae:
--> r = prettyprint([-3, 1])
r = v--- here we don't have any +, and it's fine
${\begin{pmatrix}-3&1\cr \end{pmatrix}}$
3) "\time" is use between the mantissa and the exponent. It is very bulky. Some negative space
could be applied on both sides, for a more compact smarter rendering.
Please see the attachment, coming from
--> c = [complex(1,%nan) complex(-1.25d-12, 2); complex(%inf,6.1e167), complex(1,%inf)]
c =
1. + Nani -1.250D-12 + 2.i
Inf + 6.10D+167i 1. + Infi
--> r = prettyprint(c)
r =
${\begin{pmatrix}1{\mathrm{NaN}}i&-1.250\times10^{-12}+2i\cr {\infty}+6.10\times10^{+
167}i&1+{\infty}i\cr \end{pmatrix}}$
ERROR LOG:
----------
HOW TO REPRODUCE THE BUG:
-------------------------
r = prettyprint(complex(1,%nan))
c = [complex(1,%nan) complex(-1.25d-12, 2); complex(%inf,6.1e167), complex(1,%inf)];
r = prettyprint(c)