Boil
Boil

Reputation:

Square Root for Bigint in F#

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.

Upvotes: 5

Views: 2015

Answers (2)

Codingday
Codingday

Reputation: 855

Happy Square Root Day to you too :).

I don't think there is built-in in bigint

Upvotes: 0

MarkusQ
MarkusQ

Reputation: 21940

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

Upvotes: 2

Related Questions