Skip to content

Commit b5b709d

Browse files
authored
Replaced sqrt by pow
1 parent a41656f commit b5b709d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/com/thealgorithms/maths/Means.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ public static Double quadratic(final Iterable<Double> numbers) {
126126
checkIfNotEmpty(numbers);
127127
double sumOfSquares = StreamSupport.stream(numbers.spliterator(), false).reduce(0d, (x, y) -> x + y * y);
128128
int size = IterableUtils.size(numbers);
129-
return Math.sqrt(sumOfSquares / size);
129+
return Math.pow(sumOfSquares / size, 0.5);
130130
}
131131

132132
/**

0 commit comments

Comments
 (0)