File tree 2 files changed +4
-7
lines changed
src/main/java/com/thealgorithms/maths
2 files changed +4
-7
lines changed Original file line number Diff line number Diff line change 219
219
<Match >
220
220
<Bug pattern =" FCBL_FIELD_COULD_BE_LOCAL" />
221
221
</Match >
222
- <Match >
223
- <Bug pattern =" IMC_IMMATURE_CLASS_VAR_NAME" />
224
- </Match >
225
222
<Match >
226
223
<Bug pattern =" CFS_CONFUSING_FUNCTION_SEMANTICS" />
227
224
</Match >
Original file line number Diff line number Diff line change @@ -5,16 +5,16 @@ private StandardDeviation() {
5
5
}
6
6
7
7
public static double stdDev (double [] data ) {
8
- double var = 0 ;
8
+ double variance = 0 ;
9
9
double avg = 0 ;
10
10
for (int i = 0 ; i < data .length ; i ++) {
11
11
avg += data [i ];
12
12
}
13
13
avg /= data .length ;
14
14
for (int j = 0 ; j < data .length ; j ++) {
15
- var += Math .pow ((data [j ] - avg ), 2 );
15
+ variance += Math .pow ((data [j ] - avg ), 2 );
16
16
}
17
- var /= data .length ;
18
- return Math .sqrt (var );
17
+ variance /= data .length ;
18
+ return Math .sqrt (variance );
19
19
}
20
20
}
You can’t perform that action at this time.
0 commit comments