问题
Is there a way to get the square root of a big integer? I am dealing with numbers that are much too large for int64 to handle so bigint is a must.
I was considering the idea of implementing it myself using the Babylonian method, but want to know if there are any built in functions for this first.
Thanks in advance.
回答1:
You can use newton's method on any scalar.
http://en.wikipedia.org/wiki/Newton%27s_method
-- MarkusQ
P.S. See also http://en.wikipedia.org/wiki/Methods_of_computing_square_roots
回答2:
Happy Square Root Day to you too :).
I don't think there is built-in in bigint
来源:https://stackoverflow.com/questions/608514/square-root-for-bigint-in-f