From specs https://en.cppreference.com/w/cpp/numeric/math/atan, it seems std::atanf exist on C++11, but on godbolt it says 'atanf' is not a member of 'std':
#include <iostream>
#include <cmath>
int main()
{
float sampleOverLoaded = 200.0f;
float outputAtan = atanf(sampleOverLoaded);
float outputAtanStd = std::atanf(sampleOverLoaded);
std::cout << outputAtan << std::endl;
std::cout << outputAtanStd << std::endl;
}
What's wrong? Notice I don't want to use atanhf.
This is a long-standing bug which has been resolved in November 2023 for GCC14. See GCC Bug 79700 -
std::fabsfandstd::fabslmissing from<cmath>.std::atanfis in the C++11 standard, but no one bothered adding it for the last 12 years or so. Some people also think it shouldn't exist (see the linked bug for more discussion).For the time being, use
std::atan. It's an overloaded function which acceptsfloat,double, andlong double: