Other places that use `abs` as opposed to `std::abs` for floats/doubles that could be affected:
KrisThielemans opened this issue · 1 comments
Following from #1409, we need to check other places that use abs
for floats/doubles that could be affected. Simplest is to just replace them with std::abs
, but it'd be good to know if there was a problem or not. I guess easiest might be to put an error abs(1.5)-1>.2
while checking.
Copying from #1409 (comment)_
Library: (worrying!)
- ProjDataInfo::get_sampling_in*: are not affected, but I don't know why
- inverse_SSRB
- extend_projdata
Utilities:
- shift_image (maybe not due to
#include <math.h>
) - find_fwhm_in_image.cxx (possibly not due to
using namespace std;
)
Relatively harmless as error checking:
- ExamInfo::operator==, - Radionuclide::operator==
- TimeFrameDefinitions::operator==
- error checking in ProjMatrixByBinSPECTUB
- error checking in ProjMatrixByBinUsingRayTracing
Test code:
Commented out code, hence harmless (but confusing):
The inverse_SSRB tests still pass even if the expressions passed into abs() are cast to integers before. I think it would require some quite elaborate design of the scanner rings and downsampling to find a case where the logic would be vulnerable to the int conversion. Nonetheless, it would definitely be saver to switch to std::abs.