Skip to content

Commit

Permalink
Nit fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ashenfad committed Mar 30, 2012
1 parent 0f6ad5a commit 283d87c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/clj/histogram/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -153,14 +153,15 @@
(seq (.uniform hist max-bins)))

(defn median
"Returns an approximate median."
"Returns an approximate median for the points inserted into the
histogram."
[^Histogram hist]
(first (uniform hist 2)))

(defn mean
[^Histogram hist]
"Returns the mean."
(when (not (empty? (.getBins hist)))
"Returns the mean for the points inserted into the histogram."
(when-not (empty? (.getBins hist))
(.getMean ^Bin (reduce (fn [^Bin b1 ^Bin b2] (.combine b1 b2))
(.getBins hist)))))

Expand Down

0 comments on commit 283d87c

Please sign in to comment.