From 759833538095fcd3096bb8dd8a5391688537f8b0 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: http://svn.ruby-lang.org/repos/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') diff --git a/missing/cbrt.c b/missing/cbrt.c new file mode 100644 index 000000000..54db2703a --- /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