Commits

larry committed 5866f3b

Fiddling with` the odds calculator.

Comments (0)

Files changed (1)

 		# and with the sorts of numbers we work with in mille
 		# they'll now always fit in a 32-bit int--the idea is
 		# this'll be kinder to the conversion to double
-		while True:
+		mask = 3
+		shift = 2
+		while mask:
 			orred = numerator | denominator
-			if orred & 3:
-				break
-			numerator >>= 2
-			denominator >>= 2
-		if not (orred & 1):
-			numerator >>= 1
-			denominator >>= 1
+			if orred & mask:
+				mask >>= 1
+				shift -= 1
+				continue
+			numerator >>= shift
+			denominator >>= shift
 
 		return 1.0 - (numerator / denominator)