Skip to content

Commit 64e14bc

Browse files
committed
changed V2 to v2
Signed-off-by: Emmanuel Mireku Omari <omariemmanuel91@gmail.com>
1 parent f489d59 commit 64e14bc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
package com.baeldung.math.percentdiffbetweentwonumbers;
22

33
public class PercentDiffBetweenTwoNumbers {
4-
public static double calculatePercentageDifference(double v1, double V2) {
5-
double average = (v1 + V2) / 2;
4+
public static double calculatePercentageDifference(double v1, double v2) {
5+
double average = (v1 + v2) / 2;
66
if (average == 0) {
77
throw new IllegalArgumentException("The average of V1 and V2 cannot be zero.");
88
}
9-
return Math.abs((v1 - V2) / average) * 100;
9+
return Math.abs((v1 - v2) / average) * 100;
1010
}
1111
}

0 commit comments

Comments
 (0)