Re: [sympy] How to make nsimplify give approximate fraction

2020-08-10 Thread Paul Royik
Thank you. It works. On Monday, August 10, 2020 at 11:04:38 PM UTC+3, Aaron Meurer wrote: > > I'm not sure if you can get that with nsimplify(). I tried playing > with the tolerance and rational_conversion arguments, but it either > tries to be smart and reconstruct the original fraction, or it

Re: [sympy] How to make nsimplify give approximate fraction

2020-08-10 Thread Aaron Meurer
I'm not sure if you can get that with nsimplify(). I tried playing with the tolerance and rational_conversion arguments, but it either tries to be smart and reconstruct the original fraction, or it gives the exact base-2 fraction represented by the float (4793116746272885/1125899906842624). If I

[sympy] How to make nsimplify give approximate fraction

2020-08-10 Thread Paul Royik
nsimplify((Integer(149)/25).evalf()) outputs 149.25, as expected nsimplify((Integer(149)/35).evalf()) outputs 149/35, which is not expected as it is repeating decimal. How to make it perform approximation to given precision: 4257142857142857/10**15 ? -- You received this message because you