#16858: Print RDF and CDF elements with more digits
-------------------------------------+-------------------------------------
Reporter: jdemeyer | Owner:
Type: defect | Status: new
Priority: blocker | Milestone: sage-6.4
Component: basic arithmetic | Resolution:
Keywords: | Merged in:
Authors: | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Commit:
u/jdemeyer/ticket/16858 | 4957ed4306eaa69b0b20a14b056c1ff3f6a6c19c
Dependencies: | Stopgaps:
-------------------------------------+-------------------------------------
Changes (by jdemeyer):
* commit: => 4957ed4306eaa69b0b20a14b056c1ff3f6a6c19c
* component: linear programming => basic arithmetic
Old description:
> With the optional package `cbc` installed:
> {{{
> sage -t --long src/sage/numerical/mip.pyx
> **********************************************************************
> File "src/sage/numerical/mip.pyx", line 1470, in
> sage.numerical.mip.MixedIntegerLinearProgram.number_of_variables.add_constraint
> Failed example:
> p.solve() # rel tol 1e-15
> Expected:
> 6.666666666666666
> Got:
> 6.66666666667
> Tolerance exceeded: 5e-13 > 1e-15
> **********************************************************************
> [...several similar failures not shown...]
> }}}
>
> The underlying reason is that the `coin` solver returns an `RDF` element,
> while the `glpk` solver returns a Python float. These are printed
> differently, even though they have the same value.
New description:
With the optional package `cbc` installed:
{{{
sage -t --long src/sage/numerical/mip.pyx
**********************************************************************
File "src/sage/numerical/mip.pyx", line 1470, in
sage.numerical.mip.MixedIntegerLinearProgram.number_of_variables.add_constraint
Failed example:
p.solve() # rel tol 1e-15
Expected:
6.666666666666666
Got:
6.66666666667
Tolerance exceeded: 5e-13 > 1e-15
**********************************************************************
[...several similar failures not shown...]
}}}
The underlying reason is that the `coin` solver returns an `RDF` element,
while the `glpk` solver returns a Python float. These are printed
differently, even though they have the same value.
The branch here changes `__repr__` for `RDF` and `CDF` elements and fixes
tons of doctests. Other small fixes are switching `__str__` and `__repr__`
for some classes in `real_roots.pyx` and some doctest reformatting.
--
Comment:
New commits:
||[http://git.sagemath.org/sage.git/commit/?id=4957ed4306eaa69b0b20a14b056c1ff3f6a6c19c
4957ed4]||{{{Print RDF and CDF elements like Python floats}}}||
--
Ticket URL: <http://trac.sagemath.org/ticket/16858#comment:4>
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 http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.