Commit c85dfef7 by Roger Sayle Committed by Roger Sayle

std_cmath.h: Don't import C99's float transcendentals into the __gnu_cxx::__c99_binding...


	* include/c_std/std_cmath.h: Don't import C99's float transcendentals
	into the __gnu_cxx::__c99_binding namespace.
	(acos, asin, atan, atan2, ceil, cosh, exp, floor, fmod, frexp,
	ldexp, log, log10, modf, pow, sinh, tan, tanh): Implement using
	GCC's math builtins, i.e. __builtin_foo.
	* libmath/stubs.c (acosf, acosl, asinf, asinl, atanf, atanl,
	ceilf, ceill, floorf, floorl, fmodf, fmodl, frexpf, frexpl,
	ldexpf, ldexpl, modff, modfl): Provide stub implementations.

From-SVN: r73629
parent 1f7290e6
2003-11-15 Roger Sayle <roger@eyesopen.com>
* include/c_std/std_cmath.h: Don't import C99's float transcendentals
into the __gnu_cxx::__c99_binding namespace.
(acos, asin, atan, atan2, ceil, cosh, exp, floor, fmod, frexp,
ldexp, log, log10, modf, pow, sinh, tan, tanh): Implement using
GCC's math builtins, i.e. __builtin_foo.
* libmath/stubs.c (acosf, acosl, asinf, asinl, atanf, atanl,
ceilf, ceill, floorf, floorl, fmodf, fmodl, frexpf, frexpl,
ldexpf, ldexpl, modff, modfl): Provide stub implementations.
2003-11-14 Paolo Carlini <pcarlini@suse.de> 2003-11-14 Paolo Carlini <pcarlini@suse.de>
* testsuite/22_locale/locale/cons/12352.cc: Use * testsuite/22_locale/locale/cons/12352.cc: Use
......
...@@ -34,6 +34,57 @@ ...@@ -34,6 +34,57 @@
we use the crude approximation. We'll do better later. */ we use the crude approximation. We'll do better later. */
#ifndef HAVE_ACOSF
float
acosf(float x)
{
return (float) acos(x);
}
#endif
#ifndef HAVE_ACOSL
long double
acosl(long double x)
{
return acos((double) x);
}
#endif
#ifndef HAVE_ASINF
float
asinf(float x)
{
return (float) asin(x);
}
#endif
#ifndef HAVE_ASINL
long double
asinl(long double x)
{
return asin((double) x);
}
#endif
#ifndef HAVE_ATANF
float
atanf(float x)
{
return (float) atan(x);
}
#endif
#ifndef HAVE_ATANL
long double
atanl(long double x)
{
return atan ((double) x);
}
#endif
#ifndef HAVE_ATAN2F #ifndef HAVE_ATAN2F
float float
atan2f(float x, float y) atan2f(float x, float y)
...@@ -51,6 +102,23 @@ atan2l(long double x, long double y) ...@@ -51,6 +102,23 @@ atan2l(long double x, long double y)
#endif #endif
#ifndef HAVE_CEILF
float
ceilf(float x)
{
return (float) ceil(x);
}
#endif
#ifndef HAVE_CEILL
long double
ceill(long double x)
{
return ceil((double) x);
}
#endif
#ifndef HAVE_COSF #ifndef HAVE_COSF
float float
cosf(float x) cosf(float x)
...@@ -102,6 +170,57 @@ expl(long double x) ...@@ -102,6 +170,57 @@ expl(long double x)
#endif #endif
#ifndef HAVE_FLOORF
float
floorf(float x)
{
return (float) floor(x);
}
#endif
#ifndef HAVE_FLOORL
long double
floorl(long double x)
{
return floor((double) x);
}
#endif
#ifndef HAVE_FMODF
float
fmodf(float x, float y)
{
return (float) fmod(x, y);
}
#endif
#ifndef HAVE_FMODL
long double
fmodl(long double x, long double y)
{
return fmod((double) x, (double) y);
}
#endif
#ifndef HAVE_FREXPF
float
frexpf(float x, int *exp)
{
return (float) frexp(x, exp);
}
#endif
#ifndef HAVE_FREXPL
long double
frexpl(long double x, int *exp)
{
return frexp((double) x, exp);
}
#endif
#ifndef HAVE_SQRTF #ifndef HAVE_SQRTF
float float
sqrtf(float x) sqrtf(float x)
...@@ -158,6 +277,23 @@ hypotl(long double x, long double y) ...@@ -158,6 +277,23 @@ hypotl(long double x, long double y)
#ifndef HAVE_LDEXPF
float
ldexpf(float x, int exp)
{
return (float) ldexp(x, exp);
}
#endif
#ifndef HAVE_LDEXPL
long double
ldexpl(long double x, int exp)
{
return ldexp((double) x, exp);
}
#endif
#ifndef HAVE_LOGF #ifndef HAVE_LOGF
float float
logf(float x) logf(float x)
...@@ -192,6 +328,31 @@ log10l(long double x) ...@@ -192,6 +328,31 @@ log10l(long double x)
#endif #endif
#ifndef HAVE_MODFF
float
modff(float x, float *iptr)
{
double result, temp;
result = modf(x, &temp);
*iptr = (float) temp;
return (float) result;
}
#endif
#ifndef HAVE_MODFL
long double
modfl(long double x, long double *iptr)
{
double result, temp;
result = modf((double) x, &temp);
*iptr = temp;
return result;
}
#endif
#ifndef HAVE_POWF #ifndef HAVE_POWF
float float
powf(float x, float y) powf(float x, float y)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment