# Where can I find software to approximate very large square roots?

I'm looking for an efficient tool that can help me approximate the square roots of large numbers to the nearest integer. (By large, I'm talking about numbers with several hundred digits.) Other than that, I don't really have any further constraints - it could be online or available as a download. Does anyone know where I could find one?

I've seen methods listed online, but those can get quite tedious after a while. I've also seen algorithms listed online, but I don't have the software needed to run the code and I don't want to spend money on it.

• How quickly does it need to work? – Mark Dec 31 '16 at 0:26
• I don't really care, to be honest - as long as it's something semi-reasonable. – NotAShoeStore Dec 31 '16 at 0:29
• Try bc. Its sqrt function should do exactly what you want. – Rob Arthan Dec 31 '16 at 0:41

Try gnu bc.

It's a free, arbitrary precision calculator.

There are versions for various operating systems.

For a Windows version, here's a link:

http://gnuwin32.sourceforge.net/packages/bc.htm

• Seems to work very well. Was already installed on my Ubuntu distro, and sqrt(5.283*10^(400)) returned 22984777571253544762896494402042951152028698330270828253442904899267\ 65026536638690484532480170934622222009873755304493891106534146892915\ 95196934610411476360351881398226440125266282644932860973368880127.82\ 9 very quickly (well under a second). – Mark Dec 31 '16 at 0:47

If you have access to Maple, the built-in function isqrt does what you want.

Syntax:

y = isqrt(x)

x must be a nonnegative integer, but size is arbitrary (no limit)

y is the closest nonnegative integer to sqrt(x)

From Maple Help:

The isqrt function computes an integer approximation to the square root of x. The approximation is exact for perfect squares, and the error is less than 1 otherwise.

However Maple isn't free -- far from it, but if you have access rights to a university, you should be able to find a lab which has Maple.

• Thanks, but unfortunately, I don't have access to Maple or access rights to a university. – NotAShoeStore Dec 31 '16 at 0:32
• @NotAShoeStore For an online calculator you can use the free Wolfram Alpha. Here is for example the nearest integer to the square root of $\lfloor \pi \cdot 10^{500} \rfloor$. – dxiv Dec 31 '16 at 1:36

It's free and works fine.

• Thanks for the link, but that doesn't seem to approximate to the nearest integer - it only provides a certain amount of digits for large roots. – NotAShoeStore Dec 31 '16 at 0:31
• You can always calculate it mechanically :) – TripleA Dec 31 '16 at 0:36
• Like I said, that gets a bit tedious after a while - I'm doing this for more than one large number. – NotAShoeStore Dec 31 '16 at 0:43