Problem with nth square root of any number

OK, so now I think this is sending me crazy. I'm looking at a problem that is a mathematical problem. Now I have no problem coming up with a solution to it, that runs in under 1 second. However I want to do it using some funky Math. Anyways, after working out the Math I got one of the equations I need to compute down to

n^(1/6)

Or the 6th root of n.

Now the Java code I have for this is as follows, since Java has no nth root function I'm raising it to a power of a 1/6.

Code :

System.out.println(Math.pow(64.0, 1/6));

Now, the only thing it will print is 1.0

However the 6th root of 64 is 2!!!!

I'm going crazy please help

Chris

Re: Problem with nth square root of any number

System.out.println(Math.pow(64,1.0/6));

Output: 2.0 ;;)

Re: Problem with nth square root of any number

Hi sayedbd2014, welcome to the forums!

Have a look at the date of this thread: the question was asked years ago (and answered by the OP straight away). I'll close this thread as some people find it annoying to read all the way through only to discover there isn't really any current question to consider.