Explorar o código

Use math.ceil when computing Evens length

dstromberg %!s(int64=13) %!d(string=hai) anos
pai
achega
3d715c458e
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      test-bloom-filter

+ 2 - 1
test-bloom-filter

@@ -6,6 +6,7 @@
 '''Unit tests for bloom_filter_mod'''
 
 import sys
+import math
 import random
 
 import bloom_filter_mod
@@ -161,7 +162,7 @@ class Evens:
 
 	def length(self):
 		'''How many members?'''
-		return self.maximum // 2
+		return int(math.ceil(self.maximum / 2.0))
 
 def and_test():
 	'''Test the & operator'''