How can I find the Square Root of a Java BigInteger?

后端 未结 19 1110
[愿得一人]
[愿得一人] 2020-11-28 08:10

Is there a library that will find the square root of a BigInteger? I want it computed offline - only once, and not inside any loop. So even computationally expensive solutio

19条回答
  •  野趣味
    野趣味 (楼主)
    2020-11-28 08:16

    you can also use binary search to find the square root of x also you can multiply it to for example 10^10 and find an integer like m by binary search since m^2

    System.out.println(m.divide(10^5)+"."+m.mod(10^5));

提交回复
热议问题