Calculator square root event listener

I am trying to write a calculator using JButtons added onto Jpanels. Getting numbers to add , divide, multilpy etc. is simple enough, but i need to write an event handler for a button which calculates the square root of a given number. This is easy enough if you want the square root of 4,9,16,25 etc but if you enter a number which produces a decimal point value it doesn't work.
I am trying to do this using a variable "number" which is of type double, but have tried using it as a float, but it still doesn't work! here is my code for handling a click on the Square root JButton.
     if(e.getActionCommand().equals("Sqrt")){
     number = new Double(jtf.getText().trim()).doubleValue();
     double rootNum = 1.000;
     while(rootNum*rootNum <= number){
          double rootTester = rootNum * rootNum;
          if(rootTester == number){
               jtf.setText(String.valueOf(rootNum));
rootNum = rootNum+1;

How about
double answer = Math.sqrt(number);

Similar Messages

  • Calculating Square root.

    Hi, I'm suppose to write a programme that asks the user to enter a number. Find the square root of that number. Format theoutput to 4 decimal places. Use Math.sqrt(double a). i.e. to find the square root of 9.56, use: double sq = Math.sqrt(9.56);
    This is what I have:
    import java.io.*;
    import java.math.*;
    public class MethodEx2
      static BufferedReader keyboard = new BufferedReader (new
      InputStreamReader(System.in));
      public static void main (String[] args) throws IOException
        double num = 0;
        System.out.print("Please enter a number");
        System.out.flush();
        num = Integer.parseInt(keyboard.readLine());
        calsqrt(num);
      public static double sqrt (double number);
        double result = 0;
        result = sqrt(number);
        System.out.print(result);
    }I keep getting an error saying that it cannot return a value from method whose result type is void at line 33, col 11.
    How do I make the program to work?

    Oh okay, thanks. I also found another typo. I fixed it but it still doesn't work. Anyway, this is my new code:
    import java.io.*;
    import java.math.*;
    public class MethodEx2
      static BufferedReader keyboard = new BufferedReader (new
      InputStreamReader(System.in));
      public static void main (String[] args) throws IOException
        double num = 0;
        System.out.print("Please enter a number");
        System.out.flush();
        num = Integer.parseInt(keyboard.readLine());
        sqrt(num);
      public static double sqrt (double number)
        double result = 0;
        result = sqrt(number);
        System.out.print(result);
    }It says that MethodEx2.java is missing return statement at line 17, column 3. I'm not sure which variable I should return. I tried 'number' and 'result' but something like this happens:
    "C:\Program Files\JBuilder9\jdk1.4\bin\javaw" -classpath "E:\Lili\School\GR12 Comp Sci\Period 1\Programs\MethodExs\Ex2\Ex2\classes;C:\Program Files\JBuilder9\jdk1.4\demo\jfc\Java2D\Java2Demo.jar;C:\Program Files\JBuilder9\jdk1.4\demo\plugin\jfc\Java2D\Java2Demo.jar;C:\Program Files\JBuilder9\jdk1.4\jre\lib\charsets.jar;C:\Program Files\JBuilder9\jdk1.4\jre\lib\ext\dnsns.jar;C:\Program Files\JBuilder9\jdk1.4\jre\lib\ext\ldapsec.jar;C:\Program Files\JBuilder9\jdk1.4\jre\lib\ext\localedata.jar;C:\Program Files\JBuilder9\jdk1.4\jre\lib\ext\sunjce_provider.jar;C:\Program Files\JBuilder9\jdk1.4\jre\lib\im\indicim.jar;C:\Program Files\JBuilder9\jdk1.4\jre\lib\jaws.jar;C:\Program Files\JBuilder9\jdk1.4\jre\lib\jce.jar;C:\Program Files\JBuilder9\jdk1.4\jre\lib\jsse.jar;C:\Program Files\JBuilder9\jdk1.4\jre\lib\rt.jar;C:\Program Files\JBuilder9\jdk1.4\jre\lib\sunrsasign.jar;C:\Program Files\JBuilder9\jdk1.4\lib\dt.jar;C:\Program Files\JBuilder9\jdk1.4\lib\htmlconverter.jar;C:\Program Files\JBuilder9\jdk1.4\lib\tools.jar" MethodEx2
    Please enter a number9
    java.lang.StackOverflowError
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)
         at MethodEx2.sqrt(MethodEx2.java:19)

  • Square root of an interval using Newton's method

    Hello!
    I am trying to create a method that calculates the square root of an interval, and I am having trouble with both the actual calculation part, as well as the base case for the recursion. I implemented a simple counter for the recursion, but was not seeing any kind of pattern for the values. (I am pretty sure the "better" values should converge to 0).
    I was wondering if anybody wanted to take a swing at it and help me out. :)
    Here is the code for my program, followed by the code for Newton's method for calculating square roots of doubles. I am supposed to use it as a reference.
    I made the simple arithmetic methods with the help of http://en.wikipedia.org/wiki/Interval_arithmetic . They seem to work fine, so I am having issues with troubleshooting!
    Thanks!
    public class Interval {
         double x1;
         double x2;
         public Interval(double newx1, double newx2){
              x1 = newx1;
              x2 = newx2;
         public String toString(){
              return "[" + this.x1 + ", " + this.x2 + "]";
         //Add an interval to the current one.
         public Interval add(Interval j){
              double tempx1 = this.x1 + j.x1;
              double tempx2 = this.x2 + j.x2;
              Interval tempInterval = new Interval(tempx1, tempx2);
              return tempInterval;
         //Subtract an interval from the current one.
         public Interval sub(Interval j){
              double tempx1 = this.x1 - j.x2;
              double tempx2 = this.x2 - j.x1;
              Interval tempInterval = new Interval(tempx1, tempx2);
              return tempInterval;
         //Multiply an interval with the current one.
         public Interval mul(Interval j){
                   double minx1 = Math.min(this.x1*j.x1, this.x2*j.x2);
                   double minx2 = Math.min(this.x1*j.x2, this.x2*j.x1);
                   double maxx1 = Math.max(this.x1*j.x1, this.x2*j.x2);
                   double maxx2 = Math.max(this.x1*j.x2, this.x2*j.x1);
                   double tempx1 = Math.min(minx1, minx2);
                   double tempx2 = Math.max(maxx1, maxx2);
                   Interval tempInterval = new Interval(tempx1, tempx2);
                   return tempInterval;
         //Divide the current interval by a new one.
         public Interval div(Interval j){
                   double minx1 = Math.min(this.x1/j.x1, this.x2/j.x2);
                   double minx2 = Math.min(this.x1/j.x2, this.x2/j.x1);
                   double maxx1 = Math.max(this.x1/j.x1, this.x2/j.x2);
                   double maxx2 = Math.max(this.x1/j.x2, this.x2/j.x1);
                   double tempx1 = Math.min(minx1, minx2);
                   double tempx2 = Math.max(maxx1, maxx2);
                   Interval tempInterval = new Interval(tempx1, tempx2);
                   return tempInterval;
         static Interval step(Interval x, Interval y) {
              // Compute a "better" guess than x for the square root of y:
              // Code for doubles: Interval better = x - (x*x - y)/(2*x);
              Interval two = new Interval(2.0, 2.0);
              Interval better = x.sub( ( (x.mul(x)).sub(y) ).div(two.mul(x)) );
              // For doubles:
              if ( Math.abs(better.x2 - better.x1) < 0.001 ) { // base case
                   System.out.println(better.toString());
                   return better;
              else {
                   return step(better, y); // try to get even better...
         static Interval sqrt(Interval y) {
              return step(y, y); //: start guessing at the square root
         public static void main(String args[]){
              Interval i = new Interval(4.0, 8.0);
              Interval j = new Interval(4.0, 8.0);
              Interval addij = i.add(j);
              Interval subij = i.sub(j);
              Interval mulij = i.mul(j);
              Interval divij = i.div(j);
              Interval sqrtj = i.sqrt(j);
              System.out.println("Intervals:");
              System.out.println(i.toString());
              System.out.println(j.toString());
              System.out.println("Add: " + addij.toString());
              System.out.println("Sub: " + subij.toString());
              System.out.println("Mul: " + mulij.toString());
              System.out.println("Div: " + divij.toString());
              System.out.println("Sqrt: " + sqrtj.toString());
    }and newton's root finder for doubles:
    public class SquareRoot {
         static final double ALLOWED_ERROR = 0.001;
          * Newton's method for finding square roots.
         static double step(double x, double y) {
              // Compute a "better" guess than x for the square root of y:
              double better = x - (x*x - y)/(2*x);
              // Are we close enough?
              if ( Math.abs(x - better) < ALLOWED_ERROR ) { // => stop: base case
                   return better;
              else {
                   return step(better, y); // try to get even better...
         static double sqrt(double y) {
              return step(y, y); //: start guessing at the square root
         public static void main(String[] args) {
              System.out.println(Math.sqrt(1234));
              System.out.println(sqrt(1234));
              // NOTE: you may need to adjust the error bound for these two to agree
    }

    Nathron wrote:
    Here is the code for my program, followed by the code for Newton's method for calculating square roots of doubles. I am supposed to use it as a reference.The only thing I can see that looks suspicious is the call to step(better, y) in your reference code.
    Are you sure it shouldn't be step(y, better) or step(better, x))? Newton-Rhapson is supposed to be a progressive method, but as far as I can see the value of y can never change with the way you've got it. And if you've copied that to your new code, it might explain the problem.
    Winston

  • Help with square root calculator

    Hi: I am new to Java. Trying to write code for square root calculator of numbers 1-10. Have no idea where to start.

    Using pencil and paper, manually extract the square root of a number, and write down the steps that you use to do that. Create a Java program that does those steps.
    A Java Tutorial is here: http://java.sun.com/docs/books/tutorial/

  • ForLoop Square Root Calculator Program

    * Programmer:      R McBride
    * Date:           November 29, 2006
    * Filename:     SquareRootForLoop.java
    * Purpose:          This program uses for()loops to
    *                    find the square root of a number
    *                    up to four decimal places long.
    import APCS.Keyboard;
    class SquareRootForLoopTest1
         public static void main (String[]args)
              //define variables
              double SquareRoot = 0; //holds initial value
              double num1 = 0;
              boolean done = false;
              double tempReg1 = 0; //holds initial value of i
              double tempReg2 = 0; //holds
              double tempReg3 = 0;
              //while loop start
    //          while (!done)
              //program input
              System.out.println("\t\t\tSQUARE ROOT CALCULATOR PROGRAM");
              System.out.println(""); //skip line
              System.out.println("Enter the number you would like to be square rooted or [0] to end the program.");
              System.out.print("");
              SquareRoot = Keyboard.readInt();
              System.out.println(""); //skip line
              System.out.println("You entered "+SquareRoot+".");
              System.out.println(""); //skip line
              //for loop function
              for(int i = 0; i < 999999; i++)
              tempReg1 = i * i;
              tempReg2 = i;
    //          while (!done)
                        if(tempReg1 == SquareRoot)
                             System.out.println("The square root is "+tempReg2);
                             System.out.println("");
                        else
                             System.out.print("");
              //while loop check to finish
    //          if(SquareRoot == 0)
    //               done = true;
    //          }//end while loop
    }Here is my code for and of you who ever wants to use it. Our assignment was to make a square root calculator using ForLoop (a.k.a. no square root functions).
    My question is, how would I make it increase by .0001 instead of 1 every loop? I need it to do that so I can find square roots of numbers of numbers that have decimals for squares.

    * Programmer:      R McBride
    * Date:           November 29, 2006
    * Filename:     SquareRootForLoop.java
    * Purpose:          This program uses for()loops to
    *                    find the square root of a number
    *                    up to four decimal places long.
    import APCS.Keyboard;
    class SquareRootForLoopTest1
         public static void main (String[]args)
              //define variables
              double SquareRoot = 0; //holds initial value
              double num1 = 0;
              boolean done = false;
              double tempReg1 = 0; //holds initial value of i
              double tempReg2 = 0; //holds
              double tempReg3 = 0;
              //while loop start
    //          while (!done)
              //program input
              System.out.println("\t\t\tSQUARE ROOT CALCULATOR PROGRAM");
              System.out.println(""); //skip line
              System.out.println("Enter the number you would like to be square rooted or [0] to end the program.");
              System.out.print("");
              SquareRoot = Keyboard.readInt();
              System.out.println(""); //skip line
              System.out.println("You entered "+SquareRoot+".");
              System.out.println(""); //skip line
              //for loop function
              for(double i = 0; i < 999999; i+=.0001)
              tempReg1 = i * i;
              tempReg2 = i;
    //          while (!done)
                        if(tempReg1 == SquareRoot)
                             System.out.println("The square root is "+tempReg2);
                             System.out.println("");
                        else
                             System.out.print("");
              //while loop check to finish
    //          if(SquareRoot == 0)
    //               done = true;
    //          }//end while loop
    }Still doesn't work. =[                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Calculating the square root...

    Hi all,
    let me shortly sketch the situation.
    I have a number of fields that I select from the database (coming from different queries)
    that I need to do calculations on...
    so far, I was able to do most of those calculations, but now I'm stuck.
    One of my calculations contains a square root.
    So I got something like:
    VARIABLE1 + VARIABLE2 + SQRT(3*VARIABLE1)
    with VARIABLE1 being a multiplication of several other fields.
    my question: is there an xsl or xdofx function to calculate the square root? Or any other solutions for my problem?
    Any help would be greatly appreciated :)
    Wkr,
    Filip

    You can use like this.
    <?xdoxslt:pow(10,2)?>
    <?xdoxslt:pow(10,3)?>
    <?xdoxslt:pow(10,4)?>

  • Square root formula in Calculated Characteristics

    Have a great days.
    There are two MIC in my inspection plan. first (0010) is for entering number and another (0020) is calculated characteristics. I want to calculate the square root of 0010 charateristics in 0020.
    What should be teh formula to put in 0020 char.
    Please guide. thanks in advance.
    Regards,
    Dipesh Bhavsar
    Edited by: dipeshbhavsar1982 on Jul 31, 2011 9:41 AM

    HI
    0020 MIC should be created with control indicator for formula tab(calc.characteristic)
    and in quality plan assign the first MIC as normal
    and assign second MIC then system will ask a formula ...
    there you can give the formula in terms of character
    example (0010)2
    Faisal

  • Square root calculation method

    I'm trying to create java code that displays the square root of a number that the user enters, as I am not a great mathematician i cannot work out the logic for this. Any help would be great.
    This is the part of my code that I need assistance with: n1 is the number that the user enters and n2 is where the square root is returned to. I'm guessing that i need to have a loop of some sort to divide n1, but am unsure of the conditions. The n1 is 0 so that after the total is calculated from n1, it is cleared for another number to be entered.
    else if (source == btnSquareRoot)
    n2 = ;
    n1 = 0;
    Please help!

    An adequate method for finding a square root of a number x is this:
    Choose a number that is too low to be the actual square root. (How you do this, I don't know, but zero is pretty small and might be low enough)
    Call that number lo:
    Choose a number that is too high to be the actual square root. (Same comment. well almost. Don't use zero for this - it's too small)
    Call it hi:
    Note, it is easy to check and see that the numbers you have choosen have the required properties. because lo*lo < x and hi*hi > x
    Now you have two candidates for the square root, one of them too low and one of them two high. The actual square root lies somewhere between those two bounds.
    What you want to do now is squeeze those bounds tighter. You do that by choosing a number that is between lo and hi. The mid point would be a nice choice. You may need to figure out how to compute that.
    call that number a:
    well now, either a was itself too low, too high or just right. If it was too low, why replace lo with a and you have just improved the lower bound, if it was too high...
    surely you get the idea.
    Now the question is: How long do you keep this up? Do you ever get the actual square root this way? The answer is: Of course you don't. Most of the time the actual square root requires an infinite number of decimals to represent it. All you are looking for is something that is good enough.
    What does good enough mean? Did you want the number correct to 2 decimal places, to 4 decimals. What do you want? How can you tell if lo and hi are practically the same number?
    If this was a homework problem, that of course goes back to what the teacher wants. If the teacher did not clearly specify, you need to go back and ask what they actually wanted.
    On the other hand if you want to earn a reputations as a smart ass, you figure out some way to detect that the number that you are working on does not have an exact square root and when it does not, you simply print out the message "Sorry - the square root of the number you are looking for cannot be represented in a finite number of digits without resorting to the notation of continued fractions but here it is to 3 decimals..."
    This is the sort of stuff that wins big bonus points with professors.
    On the other hand the way you lose big points with the professors if you say something like that and CAN NOT explain to him what a continued fraction is and explain what you meant by the qualification.
    The other thing that loses big is to cut a chunk of text directly off of a web page and try to fob it off as your own program. Since most professors know how to google, they will stuff some unlikely looking phrase like "notation of continued fractions" and boom they are immediately at this page.
    My point is that if you are going to be a smart ass, you MUST do it carefully or you lose all credibility.
    Sorry for the digression there. Hope this algorithm outline is enough to get you thinking.
    Wow! Killer. I previewed my question and it put asterisks in where I wrote the word, "ass". That is Fucking awesome! They've put in some kind of bad word filter so that when I get fucking abusive with my language and call you a no good shit for brains mother fucker. it cleans it all up for me. That is just too fucking sweet! It sure is a load off of my mind. I guess they just couldn't figure out how to put in !@%#^ which is the way that you actually are supposed to replace vulgarity in the printed word. Oh well, we always knew that this site was maintained by a bunch of **** ***** * **** ***** ** ***** * * *********!

  • Fast Inverse Square Root

    I expect no replies to this thread - because there are no
    answers, but I want to raise awareness of a faculty of other
    languages that is missing in Flash that would really help 3D and
    games to be built in Flash.
    Below is an optimisation of the Quake 3 inverse square root
    hack. What does it do? Well in games and 3D we use a lot of vector
    math and that involves calculating normals. To calculate a normal
    you divide a vector's parameters by it's length, the length you
    obtain by pythagoras theorem. But of course division is slow - if
    only there was a way we could get 1.0/Math.sqrt so we could just
    multiply the vector and speed it up.
    Which is what the code below does in Java / Processing. It
    runs at the same speed as Math.sqrt, but for not having to divide,
    that's still a massive speed increase.
    But we can't do this in Flash because there isn't a way to
    convert a Number/float into its integer-bits representation. Please
    could everyone whinge at Adobe about this and give us access to a
    very powerful tool. Even the guys working on Papervision are having
    trouble with this issue.

    that's just an implementation of newton's method for finding
    the zeros of a differentiable function. for a given x whose inverse
    sq rt you want to find, the function is:
    f(y) = 1/(y*y) - x;
    1. you can find the positive zero of f using newton's method.
    2. you only need to consider values of x between 1 and 10
    because you can rewrite x = 10^^E * m, where 1<=m<10.
    3. the inverseRt(x) = 10^^(-E/2) * inverseRt(m)
    4. you don't have to divide E by 2. you can use bitwise shift
    to the right by 1.
    5. you don't have to multiply 10^^(-E/2) by inverseRt(m): you
    can use a decimal shift of inverseRt(m);
    6. your left to find the positive zero of f(y) = 1/(y*y) - m,
    1<=m<10.
    and at this point i realized what, i believe, is a much
    faster way to find inverse roots: use a look-up table.
    you only need a table of inverse roots for numbers m,
    1<m<=10.
    for a given x = 10^^E*m = 10^^(e/2) *10^^(E-e/2)*m, where e
    is the largest even integer less than or equal to E (if E is
    positive, e is the greatest even integer less than or equal to E,
    if E is negative), you need to look-up, at most, two inverse roots,
    perform one multiplication and one decimal shift:
    inverseRt(x) = 10^^(-e) * inverseRt(10) *inverseRt(m), if
    E-e/2 = 1 and
    inverseRt(x) = 10^^(-e) * inverseRt(m), if E-e/2 = 0.

  • How to find square root, log recursively???

    I need to find the square root of a number entered recursively and log as well. Your help would be greatly appreciated. Thanks in advance!
    import java.io.*;
    /**Class provides recursive versions
    * of simple arithmetic operations.
    public class Ops2
         private static BufferedReader in = null;
         /**successor, return n + 1*/
         public static int suc(int n)
              return n + 1;
         /**predecessor, return n - 1*/
         public static int pre(int n)
              if (n == 0)
                   return 0;
              else
                   return n - 1;
         /**add two numbers entered*/
         public static int add(int n, int m)
              if (m == 0)
                   return n;
              else
                   return suc(add(n, pre(m)));
         /**subtract two numbers entered*/
         public static int sub(int n, int m)
              if (n < m)
                   return 0;
              else if (m == 0)
                   return n;
              else
                   return pre(sub(n, pre(m)));
         /**multiply two numbers entered*/
         public static int mult(int n, int m)
              if (m == 0)
                   return 0;
              else
                   return add(mult(n, pre(m)), n);
         /**divide two numbers entered*/
         public static int div(int n, int m)
              if (n < m)
                   return 0;
              else
                   return suc(div(sub(n, m), m));
         /**raise first number to second number*/
         public static int exp(int n, int m)
              if (m == 0)
                   return 1;
              else
                   return mult(exp(n, pre(m)), n);
         /**log of number entered*/
         public static int log(int n)
              if (n < 2)
                   return 0;
              else
                   return suc(log(div(n, 2)));
         /**square root of number entered*/
         public static int sqrt(int n)
              if (n == 0)
                   return 0;
              else
                   return sqrt(div(n, ));
         /**remainder of first number entered divided by second number*/
         public static int mod(int n, int m)
              if (n < m)
                   return 0;
              else
                   return mod(div(n, pre(m)), m);
         public static void prt(String s)
              System.out.print(s);
         public static void prtln(String s)
              System.out.println(s);
         public static void main(String [ ] args)
              prtln("Welcome to the amazing calculator");
              prtln("It can add, multiply and do powers for");
              prtln("naturals (including 0). Note that all the");
              prtln("HARDWARE does is add 1 or substract 1 to any number!!");
              in = new BufferedReader(new InputStreamReader ( System.in ) );
              int It;
              while ( (It = getOp()) >= 0)
                   prt("" + It + "\n");
            private static int getOp( )
            int first, second;
            String op;
            try
                System.out.println( "Enter operation:" );
                do
                    op = in.readLine( );
                } while( op.length( ) == 0 );
             System.out.println( "Enter first number: " );
                first = Integer.parseInt( in.readLine( ) );
                System.out.println( "Enter second number: " );
                second = Integer.parseInt( in.readLine( ) );
             prtln("");
             prt(first + " " + op + " " + second + " = ");
                switch( op.charAt( 0 ) )
                  case '+':
                    return add(first, second);
                  case '-':
                       return sub(first, second);
                  case '*':
                    return mult(first, second);
                  case '/':
                       return div(first, second);
                  case '^':
                    return exp(first, second);
                  case 'v':
                       return log(first);
                  case 'q':
                       return sqrt(first);
                  case '%':
                       return mod(first, second);
                  case 's':
                       return suc(first);
                  case 'p':
                       return pre(first);
                  default:
                    System.err.println( "Need +, *, or ^" );
                    return -1;
            catch( IOException e )
                System.err.println( e );
                return  0;
    }

    Hi,
    Is there any one to make a program for me in Turbo
    C++ for Dos, which can calculate the square root of
    any number without using the sqrt( ) or any ready
    made functions.
    The program should calculate the s.root of the number
    by a formula or procedure defined by the user
    (programmer).
    Thanks.This is a Java forum!
    If you want Java help:
    1. Start your own thread.
    2. Use code tags (above posting box) if you post code.
    3. No one will write the program for you. We will help by answering your questions and giving advice on how to fix problems in code you wrote.
    4. The formula you need to implement is given above by dizzy.

  • Sampling procedure-Square root n+1

    Hi All,
    I need to calculate the sample size based on the Containers & Square  root n+1.
    How to configure the system & how to maintain the master data to get the sample size.
    User also insisted only the sample size has to be calculated, but he will enter only one composite result entry
    Regards
    Subbu

    Hi Subbu,
    you can use Physical Sample to control the sample Size.
    You must to define a Sample Drawing Procedure (QPV2) as relevant for Container Number, then assign the formula 'Square Root n1´ ( TRUNC(SQRT(P2)1) ) in the partial sample. In this scenario, I suggest you to configure the "Container number' as a mandatory field during the goods receipt once the system will need this information to calculate the sample. For a single result recording, you can define a pooled sample.
    I hope it can help you.
    Best regards,
    Robson

  • Calculate Square Root?

    Can I use Simplified field notation to calculate the square root of another field? Not having any success.

    No. You need to use the Custom Script option, with some code like this (assuming the name of the other field is Text1):
    event.value = Math.sqrt(+this.getField("Text1").value);

  • Calculate square root including sum and product

    Hi,
    I have to enter the square root of:
    Text1*Text1+Text2*Text2-2*Text1*Text2*Text3
    How do i do that?
    I hope someone can help me.

    Thanks a million try67,
    i found another way that worked as well:
    event.value = Math.sqrt(+this.getField("Text1").value*this.getField("Text1").value+this.getField("Text2 ").value*this.getField("Text2").value-2*this.getField("Text1").value*this.getField("Text2" ).value*this.getField("Text3").value)
    Mine is much more confuse:)

  • Square root of a channel

    I am trying to use Diadem and still learning to do basic calculations.
    Given a channel containing several values. How do I calculate that will give me another channel giving corresponding square root of values in original channel..?
    Thanks. Himanshu.
    Solved!
    Go to Solution.

    In the Analysis panel you can bring up the calculator and enter the following equation Ch("[1]/results" )=Sqr(Ch("[1]/baseVals" )).
    If you are doing this in script you can use the following. 
      Call ChnCalculate("Ch(""[1]/results"" )=Sqr(Ch(""[1]/baseVals"" ))" ) 
    Hope this helps.
    Message Edited by waynecj7 on 05-07-2009 08:51 PM

  • Square root function missing

    Whether you use the Dashboard calculator widget or the Calculator that is built into the Apple OS as an application, there is no button for square root.
    If you are using the Calculator application you can toggle the interface from Basic to Scientific to Programmer. Scientific includes buttons that square a number but no button for square root.
    Why? Or am I missing a hidden keystroke or something?

    Remember Square Root is the same as x^(1/2)
    If you have an x^y button (showing x raised to a power) enter the second number as .5, and you'll have a square root. And if you are really starving, there is Emu:
    http://emu48mac.sourceforge.net/

Maybe you are looking for

  • How to add a version by default depending on previous version found in db of a record?

    Hello, How to add a version by default depending on previous version found in db of a record? E.g                        ID 0001  Version : 1         when inserting id 0001 version 2. I want the version to be added automatically on insert , depending

  • Logistics Invoice Verification (LIV) -IR before GR

    Hi All, We're going to post an invoice for a certain Purchase Order (PO) where no goods receipts had been posted yet. Is there any anyone who knows what tolerance key and system message should I need to configured in order for the system to check the

  • Lightroom 3 quit working...?

    I have Lightroom 3.  I own the CD.  Have used it for years.  Today - I can not log in to it.  It brings me to the License or try screen - next asks for the serial number - but I can get no further than this.  What can I do?

  • Deleteing quota entry from MS Windows

    Hi everyone, I need help on deleting an already existing quota entry in MS Windows XP. I used java to run the commands available in FSUTIL QUOTA in CMD and I was able to create and modify quota... The problem is that I cannot delete an already existi

  • Very slow to when execute xmlElements.add

    Why is tha it takes a very looooong time to execute below instruction, myXMLElement = myRootXmlElement.xmlElements.add("image", app.selection[myCounter].images.firstItem()); Please advise. Thank you.