Ruby 3.3.6p108 (2024-11-05 revision 75015d4c1f6965b5e85e96fb309f1f2129f933c0)
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