Skip to content

Fix(eval): Correctly handle scientific notation in expressions #1

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

google-labs-jules[bot]
Copy link

This change fixes a bug in the evaluate_expr function that caused incorrect handling of expressions in scientific notation. The function now correctly returns the expression if it can be converted to a float, and a related test has been improved for clarity.

The `evaluate_expr` function was incorrectly calling `convert_scinot` on expressions that could already be converted to a float. This would cause expressions in scientific notation to be processed incorrectly.

This change corrects the `evaluate_expr` function to return the expression directly if it can be converted to a float, preventing the incorrect processing.

Additionally, a test for scientific notation was updated to use a more descriptive variable name, improving readability.
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

Successfully merging this pull request may close these issues.

0 participants