0

Please how do you find the cube root of numbers using python

Cube root

1st Feb 2021, 5:03 PM
Quadri Lasisi
Quadri Lasisi - avatar
7 Answers
+ 3
number = int(input()) print(number**(1/3)) Basically raising a number to 1/3 will return its cube root
1st Feb 2021, 5:55 PM
Arxalier
Arxalier - avatar
+ 2
Quadri Lasisi By the way, that 4.9999 is because Floating point arithmetic has built-in problems as it's based on a binary approximation of numbers. Explained here: https://docs.python.org/3/tutorial/floatingpoint.html
2nd Feb 2021, 12:52 AM
noteve
noteve - avatar
+ 1
Search it in pandas A lib for Maths in python
1st Feb 2021, 5:05 PM
Abhay
Abhay - avatar
+ 1
Thanks so much, you were right
1st Feb 2021, 6:27 PM
Quadri Lasisi
Quadri Lasisi - avatar
+ 1
You are right, Cyan
2nd Feb 2021, 3:51 PM
Quadri Lasisi
Quadri Lasisi - avatar
0
Thanks
1st Feb 2021, 5:06 PM
Quadri Lasisi
Quadri Lasisi - avatar
0
I tried this, it gives me decimal numbers. It says cube root of 125 is 4.9999999999999999999999
1st Feb 2021, 5:40 PM
Quadri Lasisi
Quadri Lasisi - avatar