Warum ist sqrtf nicht im namespace std?
-
Topic = Frage. Mir ist das grad aufgefallen:
#include <cmath> foo=std::sqrt(bar); <--geht foo2=std::sqrtf(bar2); <--geht nicht foo3=sqrtf(bar3) <--geht
-
vielleicht gehört die funktion nicht zum standard und ist eine kompilererweiterung?
-
schau dir doch mal cmath an
inline float sqrt(float __x) { return __builtin_sqrtf(__x); } inline long double sqrt(long double __x) { return __builtin_sqrtl(__x); } template<typename _Tp> inline typename __enable_if<double, __is_integer<_Tp>::_M_type>::_M_type sqrt(_Tp __x) { return __builtin_sqrt(__x); }
-
ness schrieb:
Warum ist sqrtf nicht im namespace std?
Der Standard kennt kein sqrtf. Und dies ist dank Funktionsüberladung auch nicht notwendig.