Browse Source

Use math.ceil when computing Evens length

dstromberg 13 năm trước cách đây
mục cha
commit
3d715c458e
1 tập tin đã thay đổi với 2 bổ sung1 xóa
  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'''