git://git.novaco.in
/
p2pool.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
(parent:
5e903ce
)
fixed negative zero displayed in format_binomial_conf by using proper rounding functions
author
Forrest Voight
<forrest@forre.st>
Thu, 9 Feb 2012 20:47:23 +0000 (15:47 -0500)
committer
Forrest Voight
<forrest@forre.st>
Thu, 9 Feb 2012 20:49:55 +0000 (15:49 -0500)
p2pool/util/math.py
patch
|
blob
|
history
diff --git
a/p2pool/util/math.py
b/p2pool/util/math.py
index
9268e57
..
8e73e3c
100644
(file)
--- a/
p2pool/util/math.py
+++ b/
p2pool/util/math.py
@@
-158,7
+158,7
@@
def format_binomial_conf(x, n, conf=0.95, f=lambda x: x):
if n == 0:
return '???'
left, right = minmax(map(f, binomial_conf_interval(x, n, conf)))
- return '~%.1f%% (%.f-%.f%%)' % (100*f(x/n), 100*left-1/2, 100*right+1/2)
+ return '~%.1f%% (%.f-%.f%%)' % (100*f(x/n), math.floor(100*left), math.ceil(100*right))
def reversed(x):
try: