should 'rational with prec+4' be `prec+5'? It would take at most 5 binary
digits to get you to the next decimal digit, wouldn't it?
On Friday, March 30, 2018 at 1:37:57 AM UTC-5, Chris Smith wrote:
>
> Is this expected behavior for evaluating Rationals:
>
> Rational of a string produces the exact decimal as a fraction:
>
> >>> Rational('.975159')
> 975159/1000000
>
> 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 affecting rounding in the 6th decimal position when
> we are trying to evaluate to the 2nd position? And I would have expected
> the split to be much closer to 5000 than 5158.
>
> /c
>
--
You received this message because you are subscribed to the Google Groups
"sympy" 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 https://groups.google.com/group/sympy.
To view this discussion on the web visit
https://groups.google.com/d/msgid/sympy/3eb9fb93-62e6-4e18-9791-547eb9a4a1fd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.