Calculating nth root in Java using power method

后端 未结 9 2680
礼貌的吻别
礼貌的吻别 2021-02-18 22:08

I was trying to get a cubic root in java using Math.pow(n, 1.0/3) but because it divides doubles, it doesn\'t return the exact answer. For example, with 125, this g

9条回答
  •  一向
    一向 (楼主)
    2021-02-18 22:43

    I'd go for implementing my own function to do this, possibly based on this method.

提交回复
热议问题