Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

certain expressions make it crash #75

Open
folkertvanheusden opened this issue Aug 2, 2022 · 1 comment
Open

certain expressions make it crash #75

folkertvanheusden opened this issue Aug 2, 2022 · 1 comment

Comments

@folkertvanheusden
Copy link

e.g.:

2 ^ 999999999999999999999999999999999999

@yd4011439
Copy link

There is a one quick fix for this but will always return float as output for '^' operator.

import math
from py_expression_eval import Parser
parser = Parser()
parser.ops2['**'] = math.pow
parser.ops2['^'] = math.pow
parser.parse("2^99999999").evaluate({})

# This will cause
OverflowError: math range error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants