-
Notifications
You must be signed in to change notification settings - Fork 8
better coverage for irrational fractions equality comparison #739
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
base: main
Are you sure you want to change the base?
Conversation
198143f to
41f8efa
Compare
d6b749b to
63c3257
Compare
omnn/math/Fraction.cpp
Outdated
| auto bothAreRational = (IsRational() && fraction.IsRational()) == YesNoMaybe::Yes; | ||
| if (bothAreRational) { | ||
| equal = operator a_rational() == static_cast<a_rational>(fraction); | ||
| } else { // TODO: FIXME: both irrationals hangs on macos | ||
| //OptimizeOn on; | ||
| //equal = numerator() * fraction.denominator() == fraction.numerator() * denominator(); | ||
| } else { // both are irrational | ||
| OptimizeOn on; | ||
| equal = numerator() * fraction.denominator() == fraction.numerator() * denominator(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Performance and Documentation Concerns:
-
The code was previously commented out with a note about hanging on macOS (
// TODO: FIXME: both irrationals hangs on macos). While enabling this code improves coverage for irrational fractions equality comparison, there's no explanation of why it's now safe to enable or what testing was done to verify it works correctly on macOS. -
The PR enables previously disabled code without adding any documentation explaining the change. This makes it difficult for future developers to understand why this code was previously problematic and what has changed to make it work now.
Recommendation:
- Add documentation or comments explaining what changes have been made to resolve the hanging issue
- Add information about what testing has been performed to verify this code now works correctly on all platforms including macOS
- Consider adding unit tests that specifically verify this functionality works as expected
07256bf to
b4aad0d
Compare
e2ce1b3 to
ea6e896
Compare
76d7803 to
61632e7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything looks good! The implementation for irrational fractions equality comparison is now more robust with proper optimization strategies.
f2b3b27 to
2486d0e
Compare
better coverage for irrational fractions equality comparison