Return 0.0 from mean of empty collection
This commit is contained in:
parent
685bc86fc0
commit
f83ad0f8ef
@ -11,7 +11,7 @@
|
|||||||
count (count coll)]
|
count (count coll)]
|
||||||
(if (pos? count)
|
(if (pos? count)
|
||||||
(/ sum (float count))
|
(/ sum (float count))
|
||||||
0)))
|
0.0)))
|
||||||
|
|
||||||
(defn median [coll]
|
(defn median [coll]
|
||||||
(let [sorted (sort coll)
|
(let [sorted (sort coll)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user