#7682: Customize printing of real numbers
---------------------------+------------------------------------------------
Reporter: jason | Owner: AlexGhitza
Type: enhancement | Status: needs_work
Priority: major | Milestone: sage-4.5
Component: numerical | Keywords:
Author: Jason Grout | Upstream: N/A
Reviewer: | Merged:
Work_issues: |
---------------------------+------------------------------------------------
Comment(by jason):
Applying these patches to 4.4.2 gives several doctest errors like this:
{{{
sage -t "4.4.2-test3/devel/sage-main/sage/rings/rational_field.py"
**********************************************************************
File "/Users/grout/sage-4.4.2-test3/devel/sage-
main/sage/rings/rational_field.py", line 26:
sage: QQ(RealField(9).pi())
Exception raised:
Traceback (most recent call last):
File "/Users/grout/sage/local/bin/ncadoctest.py", line 1231, in
run_one_test
self.run_one_example(test, example, filename, compileflags)
File "/Users/grout/sage/local/bin/sagedoctest.py", line 38, in
run_one_example
OrigDocTestRunner.run_one_example(self, test, example, filename,
compileflags)
File "/Users/grout/sage/local/bin/ncadoctest.py", line 1172, in
run_one_example
compileflags, 1) in test.globs
File "<doctest __main__.example_0[4]>", line 1, in <module>
QQ(RealField(Integer(9)).pi())###line 26:
sage: QQ(RealField(9).pi())
File "parent.pyx", line 854, in
sage.structure.parent.Parent.__call__ (sage/structure/parent.c:6332)
File "coerce_maps.pyx", line 82, in
sage.structure.coerce_maps.DefaultConvertMap_unique._call_
(sage/structure/coerce_maps.c:3108)
File "coerce_maps.pyx", line 77, in
sage.structure.coerce_maps.DefaultConvertMap_unique._call_
(sage/structure/coerce_maps.c:3010)
File "rational.pyx", line 367, in
sage.rings.rational.Rational.__init__ (sage/rings/rational.c:5781)
self.__set_value(x, base)
File "rational.pyx", line 455, in
sage.rings.rational.Rational.__set_value (sage/rings/rational.c:6223)
set_from_Rational(self, x.simplest_rational())
File "real_mpfr.pyx", line 2762, in
sage.rings.real_mpfr.RealNumber.simplest_rational
(sage/rings/real_mpfr.c:17811)
return hp_intv.simplest_rational(low_open=odd, high_open=odd)
File "real_mpfi.pyx", line 2742, in
sage.rings.real_mpfi.RealIntervalFieldElement.simplest_rational
(sage/rings/real_mpfi.c:14640)
highprec = RealIntervalField_class(int(self.prec() * 1.2))(self)
File "real_mpfi.pyx", line 472, in
sage.rings.real_mpfi.RealIntervalField_class.__init__
(sage/rings/real_mpfi.c:3522)
for key,val in print_options.items():
AttributeError: 'NoneType' object has no attribute 'items'
}}}
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/7682#comment:27>
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.