From b160d23c68e2e8fcd82b96fab0977be11c2b9ec6 Mon Sep 17 00:00:00 2001 From: akr Date: Sat, 9 Feb 2008 09:36:03 +0000 Subject: * math.c (math_cbrt): new method Math.cbrt. * configure.in (cbrt): check for replacement functions. * missing/cbrt.c: new file. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15416 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- missing/cbrt.c | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 missing/cbrt.c (limited to 'missing/cbrt.c') diff --git a/missing/cbrt.c b/missing/cbrt.c new file mode 100644 index 0000000000..54db2703a0 --- /dev/null +++ b/missing/cbrt.c @@ -0,0 +1,10 @@ +#include + +double cbrt(double x) +{ + if (x < 0) + return -pow(-x, 1/3.0); + else + return pow(x, 1/3.0); +} + -- cgit v1.2.3