tiny_outcome 2.0.1 → 2.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/tiny_outcome.rb +2 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8f59aa2f60029e67a708ba51b4606394a230ced1f2dbea6c001f01a9012499eb
|
4
|
+
data.tar.gz: 3e9158d65ccbc0a0d47646684fbe5379fbfd4b3c55b5b17725dde691ac8e9852
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 898c64f22f9c0b4b193f06097ddd6a23e135088b33bb594123a20b2acc4ea8bada2fdfdda0998d25e5818a6cf4a1051f1eeb46a628b1bdafb84e4800d207ff60
|
7
|
+
data.tar.gz: 63a96dea1d7cbf4d768a4701048307e6feb61a4cced5fb56a80cba84986be0790931c3d20a3c7cd0f1a4a3be7683240f3fae876d6e91da04ad371dbf74fb41b6
|
data/lib/tiny_outcome.rb
CHANGED
@@ -86,7 +86,8 @@ class TinyOutcome
|
|
86
86
|
# probabilty = ---------------
|
87
87
|
# total samples
|
88
88
|
def probability
|
89
|
-
|
89
|
+
return 0.0 if samples == 0
|
90
|
+
value.to_s(2).count('1') / samples.to_f
|
90
91
|
end
|
91
92
|
|
92
93
|
# true if we've received at least warmup number of samples
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tiny_outcome
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeff Lunt
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-08-04 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: a tiny outcome tracker with almost no features
|
14
14
|
email: jefflunt@gmail.com
|