Return 0.0 from mean of empty collection

This commit is contained in:
Lee Spector 2023-01-07 12:10:35 -05:00
parent 685bc86fc0
commit f83ad0f8ef

View File

@ -11,7 +11,7 @@
count (count coll)]
(if (pos? count)
(/ sum (float count))
0)))
0.0)))
(defn median [coll]
(let [sorted (sort coll)