Skip to content

Commit 21dd366

Browse files
committed
added max and min to StatCounter output, updated doc
1 parent 1a97558 commit 21dd366

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

core/src/main/scala/org/apache/spark/util/StatCounter.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ class StatCounter(values: TraversableOnce[Double]) extends Serializable {
2929
private var n: Long = 0 // Running count of our values
3030
private var mu: Double = 0 // Running mean of our values
3131
private var m2: Double = 0 // Running variance numerator (sum of (x - mean)^2)
32-
private var max_v: Double = Double(-Infinity) // Running max of our values
33-
private var min_v: Double = Double(Infinity) // Running min of our values
32+
private var max_v: Double = Double.PositiveInfinity // Running max of our values
33+
private var min_v: Double = Double.NegativeInfinity // Running min of our values
3434

3535
merge(values)
3636

0 commit comments

Comments
 (0)