Re: [sympy] Re: looking for a numerical expression to fail this test

2023-09-22 Thread Aaron Meurer
I'm not saying that this sort of calculation shouldn't be doable, just that the user needs to be explicit about asking for it to happen. Also keep in mind that some evalf() calls can be very slow. This can obviously happen if the expression is large, but it can also happen for some Integrals and S

Re: [sympy] Re: looking for a numerical expression to fail this test

2023-09-22 Thread Chris Smith
> This is a great example of code that ends up being dependent on automatic evaluation behavior which makes that behavior harder to remove. If that is removed then the test will be changed to whatever mechanism will allow the sign of `self - i` to be determined. And for an arbitrary function I

Re: [sympy] Re: looking for a numerical expression to fail this test

2023-09-19 Thread Aaron Meurer
This is somewhat off-topic, but perhaps related to what you are trying to figure out, and anyway I see that this code is part of a PR https://github.com/sympy/sympy/pull/25699. I don't like how this code depends on the fact that self < i automatically evaluates to true or false. This is a great exa

[sympy] Re: looking for a numerical expression to fail this test

2023-09-19 Thread Chris Smith
`eq=(cos(2)**2+sin(2)**2-1/S(10**120))` rounds to 1 but neither `eq<1` nor `eq>1` evaluates but the correct value for `int(eq)` is 0. /c On Tuesday, September 19, 2023 at 8:14:35 AM UTC-5 Chris Smith wrote: > Given > ``` > def f(self): > from sympy.core.numbers import int_valued > r = s