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

Added comparison functions for floats and doubles… #2321

Merged
merged 5 commits into from
Dec 31, 2023

Conversation

paulhoux
Copy link
Collaborator

…providing a safer way to do things like double value; if( value == 0.0 ){}.

Compared to previous versions of the code, I have explicitly added the std:: namespace to abs. While this is not necessary in Visual Studio (it already uses std::abs by default), it may be required for other compilers. Using the C++ function std::abs if preferred over the C-function fabsf.

I also added versions for doubles.

@paulhoux paulhoux requested a review from andrewfb December 27, 2023 12:02
@paulhoux paulhoux self-assigned this Dec 27, 2023
@andrewfb
Copy link
Collaborator

Thanks for this Paul - these look like nice additions, and I'm inclined to merge this shortly unless anyone has any additional comments.

…at relied on it. Also reverted back to using this defined EPSILON_VALUE, because it's larger and more appropriate than FLT_EPSILON or DBL_EPSILON in most cases, specifically the cases for which these functions were added to Cinder.
@paulhoux
Copy link
Collaborator Author

Once accepted, please --squash this branch to a single commit when merging.

@andrewfb andrewfb merged commit e337a1a into cinder:master Dec 31, 2023
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants