tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Add exp2() and exp2f() to libm



Hi,

The attached patch add these two C99/POSIX functions to libm. They are needed to compile the latest version of FFmpeg. Unfortunately, I could not test these changes myself.

-Vitor
Index: include/math.h
===================================================================
RCS file: /cvsroot/src/include/math.h,v
retrieving revision 1.49
diff -u -r1.49 math.h
--- include/math.h      4 Oct 2009 22:59:25 -0000       1.49
+++ include/math.h      11 Jan 2010 04:54:11 -0000
@@ -194,6 +194,7 @@
 double tanh(double);
 
 double exp(double);
+float  exp2(float);
 double frexp(double, int *);
 double ldexp(double, int);
 double log(double);
@@ -282,6 +283,7 @@
 /* 7.12.6 exp / log */
 
 float  expf(float);
+float  exp2f(float);
 float  expm1f(float);
 float  frexpf(float, int *);
 int    ilogbf(float);
/*
 * exp2() wrapper for exp()
 */

#include <math.h>

double
exp2f(double x)
{
        return exp(x * M_LOG2E);
}
/*
 * exp2f() wrapper for expf()
 */

#include <math.h>

float
exp2f(float x)
{
        return expf(x * M_LOG2E);
}
Index: lib/libm/Makefile
===================================================================
RCS file: /cvsroot/src/lib/libm/Makefile,v
retrieving revision 1.91
diff -u -r1.91 Makefile
--- lib/libm/Makefile   23 Oct 2009 23:42:52 -0000      1.91
+++ lib/libm/Makefile   11 Jan 2010 04:58:51 -0000
@@ -128,7 +128,8 @@
        s_sinf.c s_tan.c s_tanf.c s_tanh.c s_tanhf.c s_trunc.c s_truncf.c \
        w_acos.c w_acosf.c w_acosh.c w_acoshf.c w_asin.c w_asinf.c w_atan2.c \
        w_atan2f.c w_atanh.c w_atanhf.c w_cosh.c w_coshf.c \
-       w_drem.c w_dremf.c w_exp.c w_expf.c w_fmod.c w_fmodf.c w_gamma.c \
+       w_drem.c w_dremf.c w_exp.c w_expf.c w_exp2.c w_exp2f.c \
+       w_fmod.c w_fmodf.c w_gamma.c \
        w_gamma_r.c w_gammaf.c w_gammaf_r.c w_hypot.c w_hypotf.c w_j0.c \
        w_j0f.c w_j1.c w_j1f.c w_jn.c w_jnf.c w_lgamma.c w_lgamma_r.c \
        w_lgammaf.c w_lgammaf_r.c w_log.c w_log10.c w_log10f.c w_log2.c \


Home | Main Index | Thread Index | Old Index