diff options
| author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-02-09 09:36:03 +0000 |
|---|---|---|
| committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-02-09 09:36:03 +0000 |
| commit | 759833538095fcd3096bb8dd8a5391688537f8b0 (patch) | |
| tree | d85dbe40e1b2ff4089f4c4f228e65e2eb09243b5 /missing | |
| parent | 9cd046263812edd9d7c10c5f52d82a9d41ffc7da (diff) | |
| download | ruby-759833538095fcd3096bb8dd8a5391688537f8b0.tar.gz ruby-759833538095fcd3096bb8dd8a5391688537f8b0.tar.xz ruby-759833538095fcd3096bb8dd8a5391688537f8b0.zip | |
* 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
Diffstat (limited to 'missing')
| -rw-r--r-- | missing/cbrt.c | 10 |
1 files changed, 10 insertions, 0 deletions
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 <math.h> + +double cbrt(double x) +{ + if (x < 0) + return -pow(-x, 1/3.0); + else + return pow(x, 1/3.0); +} + |
