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

Negative zero #23

Open
tonypottera24 opened this issue Mar 30, 2020 · 1 comment
Open

Negative zero #23

tonypottera24 opened this issue Mar 30, 2020 · 1 comment
Labels
bug Indicates an unexpected problem or unintended behavior

Comments

@tonypottera24
Copy link

math_expressions: ^2.0.0

I'm wondering if this is a bug or an expected behavior?

Expression exp = Parser().parse("-1*0");
double eval = exp.evaluate(EvaluationType.REAL, null);
print(eval);
// -0.0
@fkleon
Copy link
Owner

fkleon commented Mar 30, 2020

Thanks for the report. Looks like this is unintentional, as Dart itself evaluates -1*0.0 to positive zero, and only yields negative zero for 1*-0.0

@fkleon fkleon added the bug Indicates an unexpected problem or unintended behavior label Jul 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

2 participants