Re: [sympy] is something wrong with evaluation of Rationals?

2018-03-30 Thread Isuru Fernando
Part of it is a bug and part of it is a feature. First the bug, https://github.com/sympy/sympy/blob/7524499458cf114b32e 3aa6e8acdb77e846111f9/sympy/core/evalf.py#L1264 needs to be changed. It should be changed from from_rational(x.p, x.q, prec) to from_rational(x.p, x.q, prec, rnd). Otherwise

[sympy] is something wrong with evaluation of Rationals?

2018-03-30 Thread Chris Smith
Is this expected behavior for evaluating Rationals: Rational of a string produces the exact decimal as a fraction: >>> Rational('.975159') 975159/100 evaluation is going to be affected by rounding >>> Rational('.975158').n(2) 0.97 >>> Rational('.975159').n(2) 0.98 But why is the digit