How to take square root of it

Hi Folks!
Can anybody tell me how to take square root of this value "bi"?
BigInteger bi = BigInteger.valueOf(2000000000);
Thanks in advance.

I wrote this simple sqrt function for BigInteger.
* Returns the largest BigInteger, n, such that bigInt>=n*n.
* If round is true, the function returns n+1 if it is closer to actual square root.
* @param round if true, attempt to find a closer value by rounding up.
* @return <tt>round ? round(sqrt(bigInt)) : floor(sqrt(bigInt))</tt>
public static BigInteger sqrt(BigInteger bigInt, boolean round){
     BigInteger op = bigInt;
     BigInteger res = BigInteger.ZERO;
     BigInteger tmp;
     int shift = bigInt.bitLength()-1;     
     shift -= shift&1;
     // set one to highest power of 4 <= bigInt
     BigInteger one = BigInteger.ONE.shiftLeft(shift);
     while(one.signum()>0){
          tmp = res.add(one);
          if(op.compareTo(tmp)>=0){
               op = op.subtract(tmp);
               res = res.add(one.shiftLeft(1));
          res = res.shiftRight(1);
          one = one.shiftRight(2);
     if(round&&op.signum()!=0){
          op = bigInt.subtract(res.pow(2));
          if(op.compareTo(res)>0){
               res = res.add(BigInteger.ONE);
     return res;
}

Similar Messages

  • 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.

  • How to print square root ?

    Hi...i want to print square root on command prompt and a symbol(i don't know what it's name for second symbol). But i get a problem. Below is my code. For what i understand i should use \u221A right? :-
    public class Test
         public static void main(String[]args)
              try
                   System.out.println("\u221A");
                   System.out.println("\u00ea");
              catch(Exception e)
                   e.printStackTrace();
    }But the result is only question mark...can someone show me the right way and what's wrong to my code. I very appreciate to any help. Thank you.

    but it does show up in swing components
    import javax.swing.*;
    import java.awt.*;
    public class printsymb
         private static final String SYMBOL = String.valueOf( '\u221A' );
         public static void main( String args[] )
              display( SYMBOL );
              System.out.print( SYMBOL );
              System.out.println( 4 );
         private static void display( String symbol )
              JTextArea text = new JTextArea( symbol );
              JFrame f = new JFrame();
              f.add( text, BorderLayout.CENTER );
              enableJFrame( f );
         private static void enableJFrame( JFrame frame )
              frame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
              frame.setSize( 320, 240 );
              frame.setVisible( true );
    }you can always put it out like this "sqrt(someExp)" can't you?
    Edited by: scphan on Apr 4, 2009 1:41 PM

  • Square root approximations and loops, output not as expected

    Hi guys,
    I'm trying to create a program that uses loops to guess the approximate value of a square root of an inputted value within an epsilon value. The program will guess with a value x, then use (x + (value/x))/2 to guess a closer value, where value = sqrt(input).
    Here is my solution class:
    public class RootApproximator
       public RootApproximator(double val, double eps)
              value = val;
              square = Math.sqrt(val);
              epsilon = eps;
              lower = square - epsilon;
       public double nextGuess()
              for (double i = 1; i < lower; i++)
                   i = (i + (value/i)) / 2;
                   guess = i;
              return guess;
       public boolean hasMoreGuesses()
              return (square - guess <= epsilon);
       private double square;
       private double value;
       private double epsilon;
       private double guess;
       private double lower;
    And here is my tester:
    public class RootApproximatorTester
       public static void main(String[] args)
          double a = 100;
          double epsilon = 1;
          RootApproximator approx = new RootApproximator(a, epsilon);
          System.out.println(approx.nextGuess());
          System.out.println("Expected: 1");
          System.out.println(approx.nextGuess());
          System.out.println("Expected: 50.5");
          while (approx.hasMoreGuesses())
             approx.nextGuess();
          System.out.println(Math.abs(approx.nextGuess() - 10) < epsilon);
          System.out.println("Expected: true");
    }Something is wrong with my loop, because the expected values are not appearing. Here is what the output looks like:
    50.5
    Expected: 1
    50.5
    Expected: 1
    ... // there should be more here, it should print:
    // true
    // Expected: true
    If anyone could please point out my errors so I can finish this program I would certainly appreciate it. Thank you all.

    I've modified your code a bit.
    class RootApproximator
         private double value;
         private double accuracy;
         private double firstGuess;
         public RootApproximator(double val)
              value = val;
              accuracy = 1;
         public double makeGuess()
              double guess = firstGuess;
              for (double i = 1; i <= accuracy; i++)
                   double temp = value / guess;
                   guess = (guess + temp) / 2.0;
                   System.out.println("Next Guess: "+guess);
              return guess;
         public void setFirstGuess(double num)
              firstGuess = num;
         //the higher the accuracy, the closer the square root will be
         public void setAccuracy(int num)
              accuracy = num;
    public class Test
         public static void main(String[] args)
              System.out.println("Number to take square root of:");
              java.util.Scanner input = new java.util.Scanner(System.in);
              double num = input.nextDouble();
              System.out.println("Number of times to iterate:");
              int acc = input.nextInt();
              System.out.println("First Guess:");
              double guess = input.nextDouble();
              RootApproximator approx = new RootApproximator(num);
              approx.setAccuracy(acc);
              approx.setFirstGuess(guess);
              double sqrt = approx.makeGuess();
              System.out.println("--------------------");
              System.out.println("Final Guess: "+sqrt);
              System.out.println("Actual Square Root: "+Math.sqrt(num));
    }

  • Problems with square root approximations with loops program

    i'm having some trouble with this program, this loop stuff is confusing me and i know i'm not doing this correctly at all. the expected values in the tester are not matching up with the output. i have tried many variations of the loop in this code even modifying the i parameter in the loop which i guess is considered bad form. nothing seems to work...
    here is what i have for my solution class:
    /** A class that takes the inputted number by the tester and squares it, and
    *  loops guesses when the nextGuess() method is called. The epsilon value is
    *  also inputted by the user, and when the most recent guess returns a value
    *  <= epsilon, then the hasMoreGuesses() method should return false.
    public class RootApproximator
       /** Takes the inputted values from the tester to construct a RootApproximator.
        * @param val the value of the number to be squared and guessed.
        * @param eps the gap in which the approximation is considered acceptable.
         public RootApproximator(double val, double eps)
              value = val;
              square = Math.sqrt(val);
              epsilon = eps;
       /** Uses the algorithm where 1 is the first initial guess of the
        *  square root of the inputted value. The algorithm is defined by
        *  "If X is a guess for a square root of a number, then the average
        *  of X and value/X is a closer approximation.
        *  @return increasingly closer guesses as the method is continually used.
       public double nextGuess()
             final int TRIES = 10000;
             double guess = 1;
              for (double i = 1; i < TRIES; i++)
                   double temp = value / guess;
                   guess = (guess + temp) / 2.0;
              return guess;
       /** Determines if there are more guesses left if the difference
        *  of the square and current guess are not equal to or less than
        *  epsilon.
        *  @return the value of the condition.
       public boolean hasMoreGuesses()
              return (square - guess <= epsilon);
       private double square;
       private double value;
       private double epsilon;
       private double guess;
    here is the tester:
    public class RootApproximatorTester
       public static void main(String[] args)
          double a = 100;
          double epsilon = 1;
          RootApproximator approx = new RootApproximator(a, epsilon);
          System.out.println(approx.nextGuess());
          System.out.println("Expected: 1");
          System.out.println(approx.nextGuess());
          System.out.println("Expected: 50.5");
          while (approx.hasMoreGuesses())
             approx.nextGuess();
          System.out.println(Math.abs(approx.nextGuess() - 10) < epsilon);
          System.out.println("Expected: true");
    and here is the output:
    10.0
    Expected: 1 // not sure why this should be 1, perhaps because it is the first guess.
    10.0
    Expected: 50.5 // (100 + 1) / 2, average of the inputted value and the first guess.
    true
    Expected: true
    i'm new to java this is my first java course and this stuff is frustrating. i'm really clueless as to what to do next, if anyone could please give me some helpful advice i would really appreciate it. thank you all.

    i'm new to java this is my first java course and this
    stuff is frustrating. i'm really clueless as to what
    to do nextMaybe it's because you don't have a strategy for what the program is supposed to do? To me it looks like a numerical scheme for finding the squareroot of a number.
    Say the number you want to squarerroot is called value and that you have an approximation called guess. How do you determine whether guess is good enought?
    Well in hasMoreGuesses you check whether,
    (abs(value-guess*guess) < epsilon)
    The above decides if guess is within epsilon of being the squareroot of value.
    When you calculate the next guess in nextGuess why do you loop so many times? Aren't you supposed to make just one new guess like,
    guess = (guess + value/guess)/2.0
    The above generates a new guess based on the fact that guess and value/guess must be on each side of value so that the average of them must be closer too value.
    Now you can put the two together to a complete algoritm like,
    while (hasMoreGuesses()) {
       nextGuess();
    }In each iteration of the loop a new "guess" of the squareroot is generated and this continues until the guess is a sufficiently close approximation of the squareroot.

  • Square root algorithm?

    Okay, two things...I've always kinda wondered what the algorithm for the square-root function is...where would I find that?
    but the main thing is, I was making a class to store/deal with a complex/mixed number (a + b*i), and I was trying to make a square-root method for that. But I fiddled around with the variables in the equation, and I can't quite get any further.
    This is what I got (algebraically: this isn't actual code):
    ( the variables a, b, c, d are all real numbers )
    ( the constant i is the imaginary unit, sqrt(-1) )
    sqrt(a + b*i) == c + d*i
    a + b*i == (c + di)^2
    a + b*i == c*c - d*d + 2*c*d*i
    a == c*c - d*d
    b == 2*c*d
    c == sqrt( a + d*d )
    c == b / (2* d)
    d == sqrt( c*c - a )
    d == b / (2*c)
    right now the only thing i can conclude from that, is that if you know (a or b) and (c or d) you can determine the other variables. but I can't figure out how to define c or d purely in terms of a and b, as the method would need to. so I'm stuck.

    Okay, two things...I've always kinda wondered what the
    algorithm for the square-root function is...where
    would I find that?
    Math.sqrt()It's an extremely important skill to learn to read the API and become familiar with the tools you will use to program Java. Java has an extensive set of documentation that you can even download for your convenience. These "javadocs" are indexed and categorized so you can quickly look up any class or method. Take the time to consult this resource whenever you have a question - you'll find they typically contain very detailed descriptions and possibly some code examples.
    http://java.sun.com/reference/api/index.html
    http://java.sun.com/j2se/1.4.2/docs/api/

  • 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

  • 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);

  • 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 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)

  • 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:)

  • The square root free Cholesky factorization

    The Attached code calculates the square root free Cholesky factorization (LDL'), it is very useful to decompose matrices and in my specific case, to make observability analysis within electrical distribution networks. I'm publishing it because LV counts with other kind of decompositions like the LU decomposition, very useful but for my case, the values delivered by LDL' are more accurate and easier to calculate.
    Best regards
    Davis
    Davis Montenegro
    Attachments:
    LDLT.zip ‏33 KB

    Davis,
    How easy do you think it would be to port this over to the FPGA environment?  Just a quick inspection shows the NaN check and I am not sure how this plays into the porting of the code. 
    This is exactly what I have been working on today and would have saved myself some time if I had known someone smarter than myself had already pieced this out.   Thanks a lot!
    Matt
    Matt Richardson
    Certified LabVIEW Developer
    MSR Consulting, LLC

  • Fastest square root algorithm

    I was looking for a fast algorythm for integer square roots and I found this one http://medialab.freaknet.org/martin/src/sqrt/.
    The algorithm comes from a book by Mr C. Woo on how to do maths on an abacus.
    I post the javaized version here in case anyone finds it interesting.
    I believe this is the fastest square root function in existance for integers (and in game programming much of the time you aren't interested in fractions)
    /* Fast interger square root adapted from algorithm by Martin Guy @ UKC, June 1985.
        *   Origonally from a book on programming abaci by Mr C. Woo.
       public static int fastSqrt2(int n)
          int op, res, one;
          op = n;
          res = 0;
          /* "one" starts at the highest power of four <= than the argument. */
          one = 1 << 30;   /* second-to-top bit set */
          while (one > op) one >>= 2;
          while (one != 0)
             if (op >= res + one)
                op = op - (res + one);
                res = res +  (one<<1);
             res >>= 1;
             one >>= 2;
          return(res);
       }

    public static double sqrt(double a){
      if(a<0) throw new IllegalArgumentException("number<0");
      double precision=0.001;
      double x_nMinus1 = -1;
      double x_n = 1;
      while( Math.abs(x_n - x_nMinus1) > precision ) {
        x_nMinus1 = x_n;
        x_n = (x_nMinus1 * x_nMinus1 + a) / (2*x_nMinus1);          
      return x_n;           
    }

  • Square Root Help

    ok, I used the search function and had a hard time understanding how to do things and I don't think any of the posts answered my question.
    Right now, I am working on an assignment that makes me figure out the quadratic formula. I am having trouble with the square root part of the program.
    For instance that part is: sqrt( b*b - 4*a*c)
    I want my program to be able to tell if the square root is a perfect square then go ahead an calculate it, but if it is not, then we just want to reduce the square root function, or even if it is a perfect square, I need to make the program reduce fractions when possible.
    For instance, here is an example that is a perfect square: sqrt(25) = 5 , the program would just spit out five automatically.
    BUT
    If it were: sqrt(24), then I would want it to reduce it to 2 sqrt(6) and that is what the program would pop out.
    Also, I am having trouble on how to tell the program how to "reduce fractions" , because if I had the square root in the last example, I might be able to reduce fractions for the whole quadratic function.
    example. ( 2 - 2 sqrt(6) ) / 2              would reduce to   1 - sqrt(6) and that is what the program would say.
    basically it seems like we are avoiding actually dealing with decimals.
    If you could just point me in the right direction or have a good link, it would be appreciated!!!

    It seems to me your real problem is taking a number and finding all prime factors of that number. Once you have a list of those, you know you can pull duplicates out of the square root. If all of them were duplicates, you had a perfect square.
    Here's a simple program I scrawled out to factor and reassemble into the appropriate form:
    import java.util.*;
    class FactorTest {
        public static void main(String[] args) {
            int value = 96;
            LinkedList<Integer> factors = new LinkedList<Integer>();
            LinkedList<Integer> primeNumbers = new LinkedList<Integer>();
            populatePrimeList(primeNumbers);
            while (value > 1) {
               boolean factorFound = false;
               for (int prime : primeNumbers) {
                  if (value % prime == 0) {
                     value = value / prime;
                     factors.add(prime);
                     factorFound = true;
                     break;
               if (!factorFound) {
                  expandPrimeList(primeNumbers);
            int left = 1;
            int right = 1;
            int lastValue = 1;
            for (int factor : factors) {
               if (lastValue == factor) {
                  left *= factor;
                  lastValue = 1;
               else {
                  right *= lastValue;
                  lastValue = factor;
            right *= lastValue;
            System.out.println(left + " sqrt " + right);
        public static void populatePrimeList(LinkedList<Integer> primes) {
           primes.add(2);
           primes.add(3);
           primes.add(5);
           primes.add(7);
           primes.add(11);
           primes.add(13);
        public static void expandPrimeList(LinkedList<Integer> primes) {
           int testPrime = primes.get(primes.size() - 1);
           boolean foundFactors;
           do {
              foundFactors = false;
              testPrime += 2;
              for (int prime : primes) {
                 if (testPrime % prime == 0) {
                    foundFactors = true;
                    break;
           } while (foundFactors);
           primes.add(testPrime);
    }Edited by: jboeing on Jan 15, 2008 11:18 AM

  • 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

Maybe you are looking for