-
Notifications
You must be signed in to change notification settings - Fork 4
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
Fix wrong function from abs to fabsf #560
base: main
Are you sure you want to change the base?
Conversation
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.
Thanks for the contribution.
I think it would good opportunity to also update the tests for doubles. The asserts for doubles should probably also be tested using fabs
.
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.
Nice, thanks !
I just looked at the test case for doubles, would you mind also adding a test using fabs
?
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.
What tolerance do you want ?
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.
I guess something similar to what is done for floats. 0.000001f ?
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.
as a reminder, we have a bug, assert shouldn't be used in tests, it will only trigger if tests are compiled in debug mode.
Maybe switching to gtest everywhere could be a solution
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.
I let you open an issue about updating the tests then ? I feel it becomes out of scope of the current PR which is about fixing a warning from the Apple Clang compiler.
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.
Clearly a separate issue already identified on its own right. I was just mentioning this as we advise to use assert. We shouldn't :)
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.
Same as other file.
In C,
abs
is only for integers, I think you should be usingfabs
instead.List of things to check before making a PR
Before merging your code, please check the following:
.clang-format
;Fix #issue
keyword to autoclose the issue when merged.