0 Replies - 289 Views - Last Post: 22 March 2010 - 07:16 PM

#1 macosxnerd101   User is online

  • Games, Graphs, and Auctions
  • member icon




Reputation: 12648
  • View blog
  • Posts: 45,822
  • Joined: 27-December 08

Square Root Finder

Posted 22 March 2010 - 07:16 PM

Description: Returns the square root of a positive number using the identity sqrt(x) = e^(ln(x)/2).
public double sqrt(double x){
   return Math.pow(Math.E, Math.log(x)/2);
}

Is This A Good Question/Topic? 0
  • +

Page 1 of 1