Skip to content

fix: Properly handle "-0" literal for floating point context #2478

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

Merged
merged 18 commits into from
Aug 31, 2022

Conversation

MaxGraey
Copy link
Member

@MaxGraey MaxGraey commented Aug 28, 2022

Now -0 is always coerced to -0.0 for f64 / f32 context. Before it coerced to integer 0 first, which was wrong.

  • I've read the contributing guidelines
  • I've added my name and email to the NOTICE file

@MaxGraey MaxGraey changed the title feat: Add warning about -0 in floating point context feat: Add an error about -0 in floating point context Aug 28, 2022
@MaxGraey
Copy link
Member Author

This is very useful diagnostic's error. It's already identified several problems in tests and parseFloat behavior with parsing -0.0. That's tests now comment with TODO

@MaxGraey MaxGraey requested review from dcodeIO and removed request for dcodeIO August 31, 2022 12:09
@MaxGraey MaxGraey changed the title feat: Add an error about -0 in floating point context feat: Properly handle "-0" literal for floating point context Aug 31, 2022
@MaxGraey MaxGraey changed the title feat: Properly handle "-0" literal for floating point context fix: Properly handle "-0" literal for floating point context Aug 31, 2022
@MaxGraey MaxGraey merged commit f52f612 into AssemblyScript:main Aug 31, 2022
@MaxGraey MaxGraey deleted the neg-int-zero-warn branch August 31, 2022 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant