On 4 Nov., 01:57, "Justin C. Walker" <[EMAIL PROTECTED]> wrote: > On Oct 31, 2008, at 5:13 PM, mabshoff wrote: > sage -t devel/sage/sage/calculus/calculus.py > this has been reported, but I just noticed that there is > "significant bit noise", not insignificant bit noise: > Expected: > 6.1232339957367663e-16 > Got: > 6.1230317691118863e-16 >
I looked into this. Short answer: The Python builtin "float(...)" sucks, the Sage builtin "RDF(...)" rules! Long answer: The command in question is (after "sage: f = 5 * sin(x)" IIRC) sage: float( f(pi) ) The precision loss thus is due to the Python builtin "float()", and possibly only so on Mac. You'll get even on a Mac the awaited-for digits by doing instead: sage: RR( f(pi) ) The mathematical correct result "0.0" is gotten by: sage: float( simplify( f(pi) ) ) and of course also by sage: RR( simplify( f(pi) ) ) But even without "simplify" you get the result "0.0" by: sage: RDF( f(pi) ) It would be a good idea not only to "just fix" the numerical noise in this doctest, but also but some (or all) of the above into doctesting "calculus.py". @Michael: My own test did not yield more issues than already reported. If the ticket you wanted to open does not appear soon, I'll open an extra one just for this "calculus.py" stuff and apply a patch to it. Cheers, gsw > Justin > > -- > Justin C. Walker, Curmudgeon-at-Large > () The ASCII Ribbon Campaign > /\ Help Cure HTML Email --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---