Uses c-variants of log, sqrt, atan2 causing float to double cast

Issue #515 new
Former user created an issue

Since i don't feel comfortable signing the contributor agreement I'll describe my patch as an issue that you can fix on your own.

There's several places in the code that do sqrt(float_variable), that means using the C99/posix sqrt that takes a double, meaning there is a promotion from float to double and the "slower" double sqrt is run.

The solution for that is either using the C++ variant of sqrt (i.e. std::sqrt, that has overloads for both double and float) or using sqrtf.

The same problem exists for log, atan2, etc.

You can find them all by running cmake -DCMAKE_CXX_CLANG_TIDY="clang-tidy;-header-filter=.;-checks=-,performance-;-warnings-as-errors=*" .

Comments (0)

  1. Log in to comment