Skip to content

Conversation

@ianmackenzie
Copy link
Contributor

This is a precursor to #49 - as I started looking at the code to make sure aboutEqual and equalWithin had consistent behaviour I noticed that aboutEqual currently treats positive and negative infinity as equal! (Since isInfinite returns true for both.)

  • Fix comparison so that it does not treat positive infinity as equal to negative infinity
  • Add some tests to check this
  • For good measure, test to make sure comparisons against NaN also behave as expected (always return false)
  • Tweak test code style to use Float.Extra.aboutEqual qualified like everything else

- Fix comparison so that it does not treat positive infinity as equal to negative infinity
- Add some tests to check this
- For good measure, test to make sure comparisons against NaN also behave as expected (always return false)
- Tweak test code style to use Float.Extra.aboutEqual qualified like everything else
Copy link
Collaborator

@gampleman gampleman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, greatly appreciated!

@gampleman gampleman merged commit 59a6247 into elmcraft:master Mar 20, 2024
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.

3 participants