On 04/20/2010 07:25 AM, William Stein wrote:
On Monday, April 19, 2010, Tom Boothby<tomas.boot...@gmail.com> wrote:
+1 to consistency. IMHO, imprecise fields should represent their zero
as 0.0, as floats do.
Jason's patch does not do that....
That's right. In Sage, notice that RR(0) does not print out 0.0, it
prints out 0.000000000000000. Here is what happens after my patch:
sage: CDF(0)
0.0
sage: CC(0)
0.000000000000000
sage: float(0)
0.0
sage: complex(0,0)
0j
Note that after the patch, CDF and CC are consistent with RDF and RR.
That means that CC and RR are not consistent with a python float or
python complex.
Thanks,
Jason
On Mon, Apr 19, 2010 at 8:31 PM, Jason Grout
<jason-s...@creativetrax.com> wrote:
Look at this inconsistency:
sage: RR(0)
0.000000000000000
sage: RDF(0)
0.0
However:
sage: CDF(0)
0
sage: CC(0)
0
Shouldn't CDF(0) and CC(0) also print out decimals like RR(0) and RDF(0)?
I've posted a very small patch which does this on
http://trac.sagemath.org/sage_trac/ticket/8720. However, of course, this
necessitates changing lots of doctests. Before going through all of that
work, I thought I'd bring it up for comment here. What do people think?
Thanks,
Jason
--
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org
--
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org
--
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org