diff --git a/common/coords.go b/common/coords.go index 719073c..bd0d613 100644 --- a/common/coords.go +++ b/common/coords.go @@ -14,8 +14,8 @@ const ( numBitsPerComponent = 12 modulo = 1 << numBitsPerComponent maxPositive = modulo / 2 - minValue = -1 << numBitsPerComponent - maxValue = 1<>= 1 { var v uint8 - if zcode&m != 0 { + if zcode&m == m { v = _100_ } - if minz&m != 0 { + if minz&m == m { v |= _010_ } - if maxz&m != 0 { + if maxz&m == m { v |= _001_ } switch v { diff --git a/common/coords_test.go b/common/coords_test.go index b6f9b81..519ac4a 100644 --- a/common/coords_test.go +++ b/common/coords_test.go @@ -181,7 +181,7 @@ func outsiders(zmin, zmax int64, fn func(int64)) { } func TestBigMin(t *testing.T) { - const tries = 10 + const tries = 20 for i := 0; i < tries; i++ { x1 := rand.Intn(4000) - 2000 y1 := rand.Intn(4000) - 2000