File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Square Root of BigInteger Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Square Root of BigInteger" Watch "Square Root of BigInteger" New topic

Square Root of BigInteger

Justin Porter
Ranch Hand

Joined: Nov 20, 2004
Posts: 34
Does anyone know how I can get the square root of a BigInteger? I tried this:

It didn't like that. It said that Math.pow cannot be applied to doubles!
Any help would be appreciated, sorry for asking so many questions!

Want a free iPod, digital camera, or $300 cash? Completely legit offer at <a href="" target="_blank" rel="nofollow"></a> . I am looking for referrals which is why I need YOU!
Ernest Friedman-Hill
author and iconoclast

Joined: Jul 08, 2003
Posts: 24199

See here.

[Jess in Action][AskingGoodQuestions]
marc weber

Joined: Aug 31, 2004
Posts: 11343

I was just about to post the same link, but Ernest beat me to it.

Incidentally, since you're working with cryptography, you might be interested in the nextProbablePrime() method in BigInteger. This is new with Java 1.5.

"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
I agree. Here's the link:
subject: Square Root of BigInteger
It's not a secret anymore!