Skip to content

Commit 9d82626

Browse files
ZERICO2005mateoconlechuga
authored andcommitted
Fixed cbrtf for negative inputs
1 parent b9d91bb commit 9d82626

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libc/cbrt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
float cbrtf(float x)
44
{
5-
return powf(x, 1/3.f);
5+
return copysignf(powf(fabsf(x), 1.f/3.f), x);
66
}
77

88
double cbrt(double) __attribute__((alias("cbrtf")));

0 commit comments

Comments
 (0)