Ruby 3.5.0dev (2025-05-15 revision 87261c2d95f93f8738557cfb6f93ed14f1b483dd)
cbrt.c
1#include "ruby/missing.h"
2#include <math.h>
3
4double cbrt(double x)
5{
6 if (x < 0)
7 return -pow(-x, 1/3.0);
8 else
9 return pow(x, 1/3.0);
10}
11