Alternate square root method

Besides using the math class, may I know if there is another way to find the square root of an integer?
thank you.

Besides using the math class, may I know if there is
another way to find the square root of an integer? There are several numerical methods available. The most common is built on Newton-Raphson.
The idea is very simple. Say you want to calculate the squareroot of N. One can note that this squareroot will be somewhere between N and 1/N. So an approximate value will be in the middle like
N1 = (N + 1/N)/2.
Now you're closer and can get even closer by repeating this again with
N2 = (N1 + 1/N1)/2.
This is repeated again and again until Nx*Nx (where x are the numbers 1,2,3,4,5,6 etcetera) is sufficiently close to N. When it is Nx is the squareroot of N.

Similar Messages

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

  • Fast square root algorithm

    Does anyone here know where I can find an algorithm for a faster square root method than the one provided in java.lang.Math? I've tried Google, but can't come up with anything useful...
    Thanks in advance!

    Well, these guys writing JVM's are getting they wages
    for something.
    Also, how would Java compete to C/C++ on
    computational tasks without this?So you're only guessing. You assume that the JVM has a SQRT instruction. I checked but I couldn't find any. The other possibility is that the Math library is implemented using JNI. Well it may be in some standard libraries but there's no guarantee and also remember that a JNI call carries a lot of overhead so I'm not that sure it would pay off.
    If you can guess I'm entiteled to a guess too -:) I would be very surprised if Java generally would support a hardware accelerated square root calculation. On the other hand a C++ compiler wouldn't automatically do it either.

  • 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

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

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

  • Cannot display square root symbol in cvi

    I don't understand why this would be an issue, but if I'm writing in the source window (with the default font of NIEditor), I cannot display a square root symbol "√" - every time I type alt+251, I get "v". Ok, not a huge deal in the source window, but it is a big deal if THAT is what's being stored in a string variable I'm writing out to a file. Additionally, if I use the following to format a string:
    "Fmt(setpointUOM, "%s<W%cT/P3", 251);", then setpointUOM = "WüT/P3". If I display this variable in a string control, it displays as "W√T/P3", which is correct, but if I use it in a Text Box or save it to a sql database, it displays "WüT/P3" which is unacceptable.
    I've tried changing the fonts but nothing works or I get even stranger results. I've been dealing with/ignoring this since CVI7 and I'm currently at CVI10. Thanks for any help.
    Solved!
    Go to Solution.

    The difference in the display between W√T/P3 and WüT/P3 has to do with the character set that you select for the UI control. From what I can tell, only the OEM code pages map the √ symbol to character 251, so if you want to see √ for that character, you should pick the OEM character set, in that control.
    Entering √ with the keyboard in a CVI window seems like a much more problematic task. When you type Alt+251 on a CVI window, the keyboard driver is converting the 251 to 118 (the letter v). I don't know why it does that, but I noticed that the code that it converts 251 to varies, depending on your input language (which you can change in Control Panel>>Region and Language>>Change keyboards or other input methods). When english is selected in the language bar, it converts it to 118. With other languages, it converts it to other codes. I tried entering the unicode value for √ directly, which is Alt+221A (to enter unicode characters using the keypad, you have to follow the steps described here). But it didn't work. It still converted it to 118. I suspect the keyboard driver is doing this because it tries to map 221A to some symbol that is valid in the code page that corresponds to the input language, isn't able to, and picks what it thinks is the closest match.
    In lots of other applications (but not all) you can type Alt+251 or Alt+221A and it works just fine. This is because those applications accept unicode characters directly. Unfortunately, CVI isn't one of them. It uses code pages (a.k.a. character sets, or multibyte sequences) instead of unicode, and symbols don't have a universal meaning; they depend on the code page.
    Even if all this were not an impediment, you'd still run into the problem that in CVI 2010 you cannot change the font of the CVI source window to use an OEM character set. So, you'd still see it displayed as a v or a ü. In CVI 2012 you can change the change it, and so if you were using CVI 2012 you could conceivably use the clipboard to paste the √, but there is a bug in CVI that is preventing OEM characters from being pasted correctly (I realize the description says that it affects tree tooltips, but it's also generally affecting clipboard operations of some less commonly used character sets).
    So, to make a long story short, I think you should continue entering the code directly with the Fmt function, at least until this bug is fixed. And make sure that all UI controls that need to display this string are using the OEM character set.
    Luis

  • Java Help....square root problems...

    im just about done with this program except i have to get the square root of the last method i get and when i put in the side 4 and 2 i get 20 as the answer but i need to find the square root of it...my teacher mentioned the math method and i only have this so far and have no idea wat to do with it java.lang.Math.sqrt();
    //this is my test class with system out puts
         System.out.print("Enter the first smaller side: ");
         s1= console.readDouble();
         System.out.print("Enter the second smaller side: ");
         s2= console.readDouble();
         System.out.println("Hypotenuse= " + haveFun.getHyp(s1, s2));
    //my main class Fun with the method to get hypotenuse
         * get hypotenuse of a right triangle
    public double getHyp(double s1, double s2)
              // put your code here
              return (s1 * s1) + (s2 * s2);
         }

    and have no idea wat to do with it
    java.lang.Math.sqrt();
    Then it's time to read the manual:
    http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Math.html#sqrt(double)

  • For square root of biginteger

    Hi everyone,
    would you please tell me the link to get the implementation for one BigInteger's squre root?
    Regards,
    Ping

    Although there are no methods to get the square root in the API, you can go through the recursive solution using basic math operators:
    An = (Al / X + Al)/2 where Al is the last number from the resursion (or initially a guess), X is the number you are trying to find the root of, and An is your next closest answer. By recursively feeding An into Al, each iteration will result in An being closer to the actual square root. Repeat until you are within the error of margin you want. However, for this process to work, you need to have floating point values, so you may have to convert the values to BigDecimal objects first. I haven't been able to test this, so I hope it works.
    -JBoeing

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

    Problem:
    Using the Newton-Raphson method, find the square root of an input positive integer number (ensure that the input is positive). Compare the result with Math.sqrt (n).
    Hints:
    * Our function is f(x) = x^2 - n where n is the input number. Then, Newton-Raphson method sas that xk+1 is a better approximation for the square root of n than xk where
    xk+1 = (xk + n / xk) ---------->all the k are below the x.
    * You can take x0 as n.
    * Stop when |xk+1 - xk| < e where e is a very small number (take as 1.0E-09).
    Sample execution:
    Type the integer whose square root you would like to compute: 2
    Square root of 2 is 1.414213562373095 by Newton-Raphson method and
    1.4142135623730951 by Math class.
    I didnt understand what is formula of Newton-Raphson method exactly.Therefore, i couldnt apply the method into java.It is my lab assignment please help me until friday morning.Thanks.

    umutcan55 wrote:
    I didnt understand what is formula of Newton-Raphson method exactly.You could [start with the Wikipedia article|http://en.wikipedia.org/wiki/Newton's_method] for example.
    Therefore, i couldnt apply the method into java.So you don't actually have a Java question, right? So this is not the correct forum.
    It is my lab assignment please help me until friday morning.That's irrelevant.

  • Square root is not working...

    I wrote a simple program to derermine the square root of a number, but its not working: Heres the code:
    class root{
         static public void main(String[] args){
              int square = Math.sqrt[4];
              System.out.println("the square root is " + square);
    }I get this error mesage when running:
    C:\java_apps>javac root.java
    root.java:3: cannot find symbol
    symbol : variable sqrt
    location: class java.lang.Math
    int square = Math.sqrt[4];
    ^ (arrow points to dot after "Math")
    1 error
    Thanks!
    Jake

    Math.sqrt() is a method, so you have to invoke it with parentheses:int square = Math.sqrt(4);
    > root.java:3: cannot find symbol
    symbol : variable sqrt
    location: class java.lang.Math
    int square = Math.sqrt[4];
    ^ (arrow points to dot after "Math")Because of the square bracket the compiler is looking for an array sqrt inthe Math class. It can't find one and so you get the message.
    (Note that the Math static methods tend to return double not int, so you will have to
    deal with that as well.)

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

  • 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

Maybe you are looking for

  • My Apple ID was hacked; $70 Gift Card Gone.

    My Apple ID over night two nights ago was stolen. It was "released" by the criminal and iTunes said my Password was invalid. My Apple ID was open for the taking so I re-registered it. Any app I downloaded with it has crashed (only when I try to updat

  • How can I take my credit card information out an just use app cards

    How can I delete my credit card informations an just use app cards

  • User Exit / BADI or similar...for transaction SE10 (Transport Organizer)

    Hi folks. I am working with ECC 6.0 and I would like to kow if there is an user exit (that works during creation of a Request (workbench and customizing) ) that could give me the request number that is being created during that moment. There are some

  • Runtime error R6025 on Win 8.1

    Illustrator getting very slow after 20 min... By closing the app I get a runtime error (Microsoft Visual C++ Runtime Library) R6025. Any thoughts?

  • Messed up ipod display

    Today I dropped my IPod touch 4 and the screen got messed up. At first, it was white with vertical grey lines advancing towards the right to full grayness, but when I twisted it and pressed near the cameras, it had the left side of the screen change