How do I get the fifth root in Java?
•
Java
I'm trying to get the fifth root of the number for my program I used math pow(a,b); The way to get this, but for some reason it doesn't work
Suppose I did something like double z = math Pow (5,5) such things Once I get the value, I execute system. Net on it Out, it will print out the result of 3125 Then I execute z = math on it Pow (Z, 1 / 5) and execute system Out, it doesn't give me 5 results, not 1 Anyone can explain to me why this happened?
thank you!
Solution
Try z = math Pow(z,1.0 / 5)
1 / 5 in Java = = 0
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码