davidrichards-just_enumerable_stats 0.0.7 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION.yml +1 -1
- data/lib/just_enumerable_stats.rb +6 -8
- data/spec/just_enumerable_stats_spec.rb +4 -0
- metadata +1 -1
data/VERSION.yml
CHANGED
@@ -622,13 +622,11 @@ module Enumerable
|
|
622
622
|
self.covariance(other) / denominator
|
623
623
|
end
|
624
624
|
|
625
|
-
|
626
|
-
|
627
|
-
|
628
|
-
|
629
|
-
|
630
|
-
|
631
|
-
@to_f = self.map! {|e| e.to_f}
|
632
|
-
end
|
625
|
+
# Some calculations have to have at least floating point numbers. This
|
626
|
+
# generates a cached version of the operation--only runs once per object.
|
627
|
+
def to_f!
|
628
|
+
return true if @to_f
|
629
|
+
@to_f = self.map! {|e| e.to_f}
|
630
|
+
end
|
633
631
|
|
634
632
|
end
|