Rev 17: If we do floating point for average, we need floating point for exp_x2 in http://bazaar.launchpad.net/%7Ebzr/bzr-repodetails/trunk

John Arbash Meinel john at arbash-meinel.com
Wed Dec 24 17:53:48 GMT 2008


At http://bazaar.launchpad.net/%7Ebzr/bzr-repodetails/trunk

------------------------------------------------------------
revno: 17
revision-id: john at arbash-meinel.com-20081224175257-qg4ok98lp2x6hh2k
parent: john at arbash-meinel.com-20081224174909-ub02riq9tgkb0xts
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: trunk
timestamp: Wed 2008-12-24 11:52:57 -0600
message:
  If we do floating point for average, we need floating point for exp_x2
-------------- next part --------------
=== modified file 'gather_stats.py'
--- a/gather_stats.py	2008-12-24 17:49:09 +0000
+++ b/gather_stats.py	2008-12-24 17:52:57 +0000
@@ -128,7 +128,7 @@
         # See http://en.wikipedia.org/wiki/Standard_deviation
         # Arguably, we should be using "count-1" rather than count, depending
         # on whether you consider this a full population, or just a sample
-        exp_x2 = sum_of_squared / count
+        exp_x2 = float(sum_of_squared) / count
         stddev = math.sqrt(exp_x2 - avg*avg)
         return avg, stddev
 



More information about the bazaar-commits mailing list