summaryrefslogtreecommitdiffstats
path: root/libstdc++-v3/libmath
diff options
context:
space:
mode:
authorsayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4>2003-11-15 14:26:47 +0000
committersayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4>2003-11-15 14:26:47 +0000
commit18adc1ff3b97fd653b9c293aaabd866d8eb0cb51 (patch)
tree0b957def5b15a525410bba871e11102a1c097b00 /libstdc++-v3/libmath
parent1f8ad195e9ea69a6b1a5b42eeb8b7c4ee125314a (diff)
downloadppe42-gcc-18adc1ff3b97fd653b9c293aaabd866d8eb0cb51.tar.gz
ppe42-gcc-18adc1ff3b97fd653b9c293aaabd866d8eb0cb51.zip
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@73629 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/libmath')
-rw-r--r--libstdc++-v3/libmath/stubs.c161
1 files changed, 161 insertions, 0 deletions
diff --git a/libstdc++-v3/libmath/stubs.c b/libstdc++-v3/libmath/stubs.c
index 757af6df841..797b2017fb0 100644
--- a/libstdc++-v3/libmath/stubs.c
+++ b/libstdc++-v3/libmath/stubs.c
@@ -34,6 +34,57 @@
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
float
atan2f(float x, float y)
@@ -51,6 +102,23 @@ atan2l(long double x, long double y)
#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
float
cosf(float x)
@@ -102,6 +170,57 @@ expl(long double x)
#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
float
sqrtf(float x)
@@ -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
float
logf(float x)
@@ -192,6 +328,31 @@ log10l(long double x)
#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
float
powf(float x, float y)
OpenPOWER on IntegriCloud