clang-tidy - performance-type-promotion-in-math-fn — Extra Clang Tools 22.1.3 documentation

# Extra Clang Tools 22.1.3 documentation

## clang-tidy - performance-type-promotion-in-math-fn

# performance-type-promotion-in-math-fn

Finds calls to C math library functions (from `math.h` or, in C++, `cmath`) with implicit `float` to `double` promotions.

For example, warns on `::sin(0.f)`, because this function’s parameter is a double. You probably meant to call `std::sin(0.f)` (in C++), or `sinf(0.f)` (in C).

    float a;
    asin(a);

    // becomes

    float a;
    std::asin(a);