Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Square Root of BigInteger

 
Justin Porter
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24211
35
Chrome Eclipse IDE Mac OS X
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic