#21124: RealNumber.str(): allow specifying number of digits and do not truncate
by
default
------------------------------------+------------------------
Reporter: jdemeyer | Owner:
Type: defect | Status: new
Priority: major | Milestone: sage-7.3
Component: basic arithmetic | Resolution:
Keywords: | Merged in:
Authors: Jeroen Demeyer | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Commit:
Dependencies: | Stopgaps:
------------------------------------+------------------------
Description changed by jdemeyer:
Old description:
> 1. Implement a way to explicitly choose the number of digits for printing
> a real number.
>
> 2. Use `truncate=False` by default in the `str()` method but use
> `truncate=True` in `__repr__`. For explicit string conversions using the
> `str()` method, I assume that the user wants full control and doesn't
> want random truncation to interfere. This does not affect normal printing
> or conversion to `str`.
New description:
1. Implement a way to explicitly choose the number of digits for printing
a real number.
2. Use `truncate=False` by default in the `str()` method but use
`truncate=True` in `__repr__`. For explicit string conversions using the
`str()` method, I assume that the user wants full control and doesn't want
random truncation to interfere. This can also be seen by a lot of places
in the Sage library which call `x.str(truncate=False)`. For normal
printing or conversion to `str`, truncation is still the default.
--
--
Ticket URL: <https://trac.sagemath.org/ticket/21124#comment:3>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.