Ruby 3.3.5p100 (2024-09-03 revision ef084cc8f4958c1b6e4ead99136631bef6d8ddba)
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