mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-12-19 07:00:35 +08:00
Add automatic linter (#4214)
This commit is contained in:
@@ -22,9 +22,8 @@ public class SquareRootWithNewtonRaphsonMethod {
|
||||
double x = n; // initially taking a guess that x = n.
|
||||
double root = 0.5 * (x + n / x); // applying Newton-Raphson Method.
|
||||
|
||||
while (
|
||||
Math.abs(root - x) > 0.0000001) { // root - x = error and error < 0.0000001, 0.0000001
|
||||
// is the precision value taken over here.
|
||||
while (Math.abs(root - x) > 0.0000001) { // root - x = error and error < 0.0000001, 0.0000001
|
||||
// is the precision value taken over here.
|
||||
x = root; // decreasing the value of x to root, i.e. decreasing the guess.
|
||||
root = 0.5 * (x + n / x);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user