   "Return the arithmetic mean of vs, or nil if empty"
   [vs]
   (when (seq vs)
-    (/ (apply + vs) (count vs))))
+    (/ (reduce + vs) (count vs))))
 
 (defn median
   "Return the median value of vs, or nil if empty"

    (/ n div)))

(defn ^BigDecimal bigdecimal
  "Convert x to a java.math.BigDecimal, representing ratios as doubles"
  [x]
  (if (ratio? x)
    (bigdec (double x))
    (bigdec x)))

(defn ^BigDecimal round-bigdecimal
  "Round BigDecimal `v` to specified number of significant digits"

  (:import (java.math BigDecimal MathContext RoundingMode)))

(defn nonzero?
  "Is v non-nil and non-zero?"
  [v]
  (and v (not= 0 v)))

(defn divide-some
  "Zero-safe division (returns value or nil)"
