Skip to content
Snippets Groups Projects
Commit e65d8509 authored by James Almer's avatar James Almer Committed by Michael Niedermayer
Browse files

libm: Add fallback definition for cbrt() using pow()


The function is known to be missing in at least one target (MSVC).

Signed-off-by: default avatarJames Almer <jamrial@gmail.com>
Signed-off-by: default avatarMichael Niedermayer <michaelni@gmx.at>
parent 26345acb
No related branches found
No related tags found
No related merge requests found
...@@ -1300,6 +1300,7 @@ HAVE_LIST_PUB=' ...@@ -1300,6 +1300,7 @@ HAVE_LIST_PUB='
MATH_FUNCS=" MATH_FUNCS="
atanf atanf
atan2f atan2f
cbrt
cbrtf cbrtf
cosf cosf
exp2 exp2
......
...@@ -48,6 +48,13 @@ ...@@ -48,6 +48,13 @@
#define powf(x, y) ((float)pow(x, y)) #define powf(x, y) ((float)pow(x, y))
#endif #endif
#if !HAVE_CBRT
static av_always_inline double cbrt(double x)
{
return x < 0 ? -pow(-x, 1.0 / 3.0) : pow(x, 1.0 / 3.0);
}
#endif
#if !HAVE_CBRTF #if !HAVE_CBRTF
static av_always_inline float cbrtf(float x) static av_always_inline float cbrtf(float x)
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment