On Mon, 13 Sep 2010 at 10:27AM +0200, Fredrik Johansson wrote:
> This happens because g(25) is a Rational, so mpmath rounds it to a
> floating-point value (with 53-bit precision) upon coercion. Note:
> 
> sage: type(g(25))
> <type 'sage.rings.rational.Rational'>
> sage: Integer(Rational(60529607948876437).n(53))
> 60529607948876440
> sage: Integer(Rational(60529607948876437).n(53)) - 60529607948876432
> 8
> sage: Integer(g(25)) - h(24)
> mpf('5.0')

Interesting. So it was the "exact" answer that was causing the problem!
Thanks for the quick response and explanation.

Dan

--
---  Dan Drake
-----  http://mathsci.kaist.ac.kr/~drake
-------

Attachment: signature.asc
Description: Digital signature

Reply via email to