Flowdock
method

cbrt

Importance_2
v1_9_1_378 - Show latest stable - 0 notes - Class: Math
cbrt(p1) public

Returns the cube root of numeric.

-9.upto(9) {|x|
  p [x, Math.cbrt(x), Math.cbrt(x)**3]
}
#=>
[-9, -2.0800838230519, -9.0]
[-8, -2.0, -8.0]
[-7, -1.91293118277239, -7.0]
[-6, -1.81712059283214, -6.0]
[-5, -1.7099759466767, -5.0]
[-4, -1.5874010519682, -4.0]
[-3, -1.44224957030741, -3.0]
[-2, -1.25992104989487, -2.0]
[-1, -1.0, -1.0]
[0, 0.0, 0.0]
[1, 1.0, 1.0]
[2, 1.25992104989487, 2.0]
[3, 1.44224957030741, 3.0]
[4, 1.5874010519682, 4.0]
[5, 1.7099759466767, 5.0]
[6, 1.81712059283214, 6.0]
[7, 1.91293118277239, 7.0]
[8, 2.0, 8.0]
[9, 2.0800838230519, 9.0]
Show source
Register or log in to add new notes.