This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

pow10 and exp10


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

glibc <math.h> provides the following extensions for "10 raised to the
power of x":

double pow10(double x);
float pow10f(float x);
double exp10(double x);
float exp10f(float x);

I'm attaching a patch and several new source files to implement these.


Yaakov
Cygwin Ports
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGQqmvpiWmPGlmQSMRCO34AJ4u9kfL8dk0pNH8jQYZfNj+J7N/GgCggDuG
SVM60tshkReOre8VhmbhIog=
=VhaN
-----END PGP SIGNATURE-----

Attachment: newlib-pow10-src.tar.bz2
Description: Binary data

? newlib-pow10.diff
? newlib/libm/math/w_exp10.c
? newlib/libm/math/w_pow10.c
? newlib/libm/math/wf_exp10.c
? newlib/libm/math/wf_pow10.c
? newlib/libm/mathfp/s_exp10.c
? newlib/libm/mathfp/s_pow10.c
? newlib/libm/mathfp/sf_exp10.c
? newlib/libm/mathfp/sf_pow10.c
Index: newlib/libc/include/math.h
===================================================================
RCS file: /cvs/src/src/newlib/libc/include/math.h,v
retrieving revision 1.25
diff -u -r1.25 math.h
--- newlib/libc/include/math.h	26 Apr 2007 19:23:37 -0000	1.25
+++ newlib/libc/include/math.h	10 May 2007 05:08:27 -0000
@@ -209,6 +209,11 @@
 extern double fma _PARAMS((double, double, double));
 extern void sincos _PARAMS((double, double *, double *));
 
+#ifdef _GNU_SOURCE
+extern double exp10 _PARAMS((double));
+extern double pow10 _PARAMS((double));
+#endif /* defined (_GNU_SOURCE) */
+
 #ifndef __math_68881
 extern double log1p _PARAMS((double));
 extern double expm1 _PARAMS((double));
@@ -311,6 +316,11 @@
 extern float expm1f _PARAMS((float));
 extern void sincosf _PARAMS((float, float *, float *));
 
+#ifdef _GNU_SOURCE
+extern float exp10f _PARAMS((float));
+extern float pow10f _PARAMS((float));
+#endif /* defined (_GNU_SOURCE) */
+
 #ifndef _REENT_ONLY
 extern float acoshf _PARAMS((float));
 extern float atanhf _PARAMS((float));
Index: newlib/libm/math/Makefile.am
===================================================================
RCS file: /cvs/src/src/newlib/libm/math/Makefile.am,v
retrieving revision 1.7
diff -u -r1.7 Makefile.am
--- newlib/libm/math/Makefile.am	11 Apr 2006 19:02:15 -0000	1.7
+++ newlib/libm/math/Makefile.am	10 May 2007 05:08:31 -0000
@@ -25,7 +25,7 @@
 	s_frexp.c s_ldexp.c \
 	s_signif.c s_sin.c \
 	s_tan.c s_tanh.c \
-	w_exp2.c w_tgamma.c
+	w_exp2.c w_tgamma.c w_exp10.c w_pow10.c
 
 fsrc =	kf_rem_pio2.c \
 	kf_cos.c kf_sin.c kf_tan.c \
@@ -48,7 +48,7 @@
 	sf_frexp.c sf_ldexp.c \
 	sf_signif.c sf_sin.c \
 	sf_tan.c sf_tanh.c \
-	wf_exp2.c wf_tgamma.c
+	wf_exp2.c wf_tgamma.c wf_exp10.c wf_pow10.c
 
 libmath_la_LDFLAGS = -Xcompiler -nostdlib
 
Index: newlib/libm/mathfp/Makefile.am
===================================================================
RCS file: /cvs/src/src/newlib/libm/mathfp/Makefile.am,v
retrieving revision 1.7
diff -u -r1.7 Makefile.am
--- newlib/libm/mathfp/Makefile.am	11 Apr 2006 19:02:16 -0000	1.7
+++ newlib/libm/mathfp/Makefile.am	10 May 2007 05:08:31 -0000
@@ -22,7 +22,7 @@
 	s_erf.c e_j0.c e_j1.c w_jn.c e_hypot.c \
 	w_cabs.c w_drem.c s_asinh.c s_fmod.c \
 	e_scalb.c s_signif.c \
-	s_exp2.c s_tgamma.c
+	s_exp2.c s_tgamma.c s_exp10.c s_pow10.c
 
 fsrc =	sf_ceil.c \
 	sf_acos.c sf_frexp.c \
@@ -41,7 +41,7 @@
 	sf_erf.c ef_j0.c ef_j1.c wf_jn.c ef_hypot.c \
 	wf_cabs.c wf_drem.c sf_asinh.c sf_fmod.c \
 	ef_scalb.c sf_signif.c \
-	sf_exp2.c sf_tgamma.c
+	sf_exp2.c sf_tgamma.c sf_exp10.c sf_pow10.c
 
 libmathfp_la_LDFLAGS = -Xcompiler -nostdlib
 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]