> Can you not use Math.pow(value, 1/3)? (I know that
> there is a bug report to do with cube roots, but don't
> have time to find it right now :) )
That should be Math.pow(value, 1.0 / 3) ;-)
I am curious about the "bug". The closest thing I could find is this:
http://developer.java.sun.com/developer/bugParade/bugs/4347132.html
which is more of a feature request for taking the cube-root of a negative number.
> I am curious about the "bug". The closest thing I
> could find is this:
>
> http://developer.java.sun.com/developer/bugParade/bugs/
> 347132.html
>
> which is more of a feature request for taking the
> cube-root of a negative number.
Ah yes, that was it :) Feature request, bug report, whatever :P
I can never remember how Java deals with float/int conversion. Every time I use floats point whole numbers, I siffix them with a '.' (like Math.pow(value, 1./3.)).