framed.std.math
bigdecimal
(bigdecimal v)
Convert v to a java.math.BigDecimal, representing ratios as doubles
clamp
(clamp max-val v)
Return v, or `max-val` if v exceeds max-val
divide-some
(divide-some n div)
Zero-safe division (returns value or nil)
mean
(mean vs)
Return the arithmetic mean of vs, or nil if empty
mode
(mode vs)
Return the mode of vs, or a seq of values if vs are multi-modal
Returns nil if no mode present (all frequencies equal)
nonzero?
(nonzero? v)
Is v non-nil and non-zero?
percentage
(percentage v total)
(percentage v total places)
What percent of total is v?
Can optionally specify rounding decimal places; defaults to 2
round-bigdecimal
(round-bigdecimal precision v)
Round BigDecimal `v` to specified number of significant digits
round-places
(round-places places v)
Round double `v` to specified number of decimal places
std-dev
(std-dev vs)
(std-dev vs ddof)
variance
(variance vs)
(variance vs ddof)