Tweak lib/interval/radial_test.go if-else ordering

This commit is contained in:
Nigel Tao committed 2019-10-31 16:25:23 +11:00
1 parent 5672e7f0a6
commit 70ac26a2c5
1 file changed
+14 -14
+14 -14
View File
@@ -350,17 +350,17 @@ func (x radialInput) And(y radialInput) radialOutPair {
ox := x.canonicalize() ox := x.canonicalize()
oy := y.canonicalize() oy := y.canonicalize()
if ox <= +riRadius { if ox > +riRadius {
if oy <= +riRadius { if oy > +riRadius {
return radialOutPair{ox & oy, ox & oy} return radialOutPair{0, roLargePos}
} else { } else {
return radialOutPair{0, ox} return radialOutPair{0, oy}
} }
} else { } else {
if oy <= +riRadius { if oy > +riRadius {
return radialOutPair{0, oy} return radialOutPair{0, ox}
} else { } else {
return radialOutPair{0, roLargePos} return radialOutPair{ox & oy, ox & oy}
} }
} }
} }
@@ -380,17 +380,17 @@ func (x radialInput) Or(y radialInput) radialOutPair {
// digit, and that digit is not shared with any "small" value <= riRadius. // digit, and that digit is not shared with any "small" value <= riRadius.
const r = riRadius + 1 const r = riRadius + 1
if ox <= +riRadius { if ox > +riRadius {
if oy <= +riRadius { if oy > +riRadius {
return radialOutPair{ox | oy, ox | oy} return radialOutPair{r, roLargePos}
} else { } else {
return radialOutPair{ox | r, roLargePos} return radialOutPair{oy | r, roLargePos}
} }
} else { } else {
if oy <= +riRadius { if oy > +riRadius {
return radialOutPair{oy | r, roLargePos} return radialOutPair{ox | r, roLargePos}
} else { } else {
return radialOutPair{r, roLargePos} return radialOutPair{ox | oy, ox | oy}
} }
} }
} }