cinder / Cinder

Cinder is a community-developed, free and open source library for professional-quality creative coding in C++.
http://libcinder.org
Other
5.28k stars 939 forks source link

Added comparison functions for floats and doubles… #2321

Closed paulhoux closed 6 months ago

paulhoux commented 6 months ago

…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.

andrewfb commented 6 months ago

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

paulhoux commented 6 months ago

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