Skip to content
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

Other places that use abs as opposed to std::abs for floats/doubles that could be affected: #1415

Closed
KrisThielemans opened this issue Apr 29, 2024 · 1 comment · Fixed by #1425
Milestone

Comments

@KrisThielemans
Copy link
Collaborator

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!)

Utilities:

Relatively harmless as error checking:

Test code:

Commented out code, hence harmless (but confusing):

@markus-jehl
Copy link
Contributor

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.

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 a pull request may close this issue.

2 participants