Replies: 1 comment 1 reply
-
Unfortunately there are no thresholds for mantissa size in evalf or mpmath. I was going to suggest using lambdify but that still tries to compute the result using |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello everyone,
I am building an app with SymPy where the user can enter any expression and can evaluate it using
evalf
.The expression is parsed using
sympify
usingevaluate=False
parameter. Example:And when I call
expr.evalf
the thread (of course) blocks completely, which is a behavior I need to avoid at any cost.Is there a way to implement some kind of threshold, so that when evaluating the expression, the evaluation just returns infinity?
I was thinking about writing custom
Pow
function with a threshold that checks the arguments and decides if it just returnsoo
instead of doing the calculation. But I would really like to avoid that.Any ideas? Thank you!
Beta Was this translation helpful? Give feedback.
All reactions