-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[RF] Use std::abs all the way in RooFit
#11986
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
Conversation
As noted in d008860, using `abs()` without `std::` can be very dangerous because there might be no overload for floating point numbers. To make sure that no bugs associated to this can happen, I suggest to avoid using `abs()` without `std::` all the way in RooFit. Also, to go with modern C++ all the way, the occurences of `fabs()` and `std::fabs()` are also replaced with `std::abs()`.
|
Starting build on |
|
Build failed on ROOT-ubuntu18.04/nortcxxmod. Warnings:
And 60 more Failing tests:
|
|
Build failed on mac12/noimt. Warnings:
And 53 more Failing tests:
|
|
Build failed on ROOT-performance-centos8-multicore/cxx17. Warnings:
And 130 more Failing tests:
|
|
Build failed on mac11/cxx14. Warnings:
And 54 more Failing tests:
|
lmoneta
left a comment
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.
LGTM!
We should probably make sure that the header <cmath> is included where std::abs is used.
|
Yes you're right. It's probably alright because the CI is passing, but I'll verify that later |
|
Build failed on ROOT-ubuntu2004/python3. Errors:
|
As noted in d008860, using
abs()withoutstd::can be very dangerous because there might be no overload for floating point numbers.To make sure that no bugs associated to this can happen, I suggest to avoid using
abs()withoutstd::all the way in RooFit.Also, to go with modern C++ all the way, the occurences of
fabs()andstd::fabs()are also replaced withstd::abs().