oops, dumb oversight in regarding std::sincos

metadata
Wenzel Jakob 2011-09-12 20:07:16 -04:00
parent df34877fc6
commit 50059c52f5
1 changed files with 4 additions and 6 deletions

View File

@ -148,15 +148,13 @@ namespace std {
#else #else
inline void sincos(float theta, float *_sin, float *_cos) { inline void sincos(float theta, float *_sin, float *_cos) {
float sinValue = sinf(theta); *_sin = sinf(theta);
*_sin = sinValue; *_cos = cosf(theta);
*_cos = sqrtf(std::max(0.0f, 1.0f-sinValue*sinValue));
} }
inline void sincos(double theta, double *_sin, double *_cos) { inline void sincos(double theta, double *_sin, double *_cos) {
double sinValue = sin(theta); *_sin = sin(theta);
*_sin = sinValue; *_cos = cos(theta);
*_cos = sqrt(std::max(0.0, 1.0-sinValue*sinValue));
} }
#endif #endif
}; };