Laut cppreference acoslsollte sich die Funktion im Standard- Namespace befinden: https://en.cppreference.com/w/cpp/numeric/math/acos
Mit gcc (oder clang) wird der folgende Code jedoch nicht kompiliert:
#include <cmath>
int main()
{
long double var = std::acosl(4.0);
return 0;
}
Ich erhalte die folgende Fehlermeldung:
gay@latitude-7490:~$ g++ -std=c++11 test.cpp
test.cpp: In function 'int main()':
test.cpp:5:26: error: 'acosl' is not a member of 'std'; did you mean 'acosh'?
5 | long double truc = std::acosl( (long double)4.0);
| ^~~~~
| acosh
Was vermisse ich ? Verstehe ich cppreference falsch?
acoslohne std::Erfolg.
acosl(4.0)und std::acos(4.0l)arbeiten. Auch das Hinzufügen -stdlib=libc++Marken std::acosl(4.0)arbeiten in Clang.