@@ -158,22 +158,6 @@ private class UnsignedBitwiseAndExpr extends BitwiseAndExpr {
158158 }
159159}
160160
161- /**
162- * Gets the floor of `v`, with additional logic to work around issues with
163- * large numbers.
164- */
165- bindingset [ v]
166- float safeFloor ( float v ) {
167- // return the floor of v
168- v .abs ( ) < 2 .pow ( 31 ) and
169- result = v .floor ( )
170- or
171- // `floor()` doesn't work correctly on large numbers (since it returns an integer),
172- // so fall back to unrounded numbers at this scale.
173- not v .abs ( ) < 2 .pow ( 31 ) and
174- result = v
175- }
176-
177161/** A `MulExpr` where exactly one operand is constant. */
178162private class MulByConstantExpr extends MulExpr {
179163 float constant ;
@@ -1266,7 +1250,7 @@ private float getLowerBoundsImpl(Expr expr) {
12661250 rsExpr = expr and
12671251 left = getFullyConvertedLowerBounds ( rsExpr .getLeftOperand ( ) ) and
12681252 right = getValue ( rsExpr .getRightOperand ( ) .getFullyConverted ( ) ) .toInt ( ) and
1269- result = safeFloor ( left / 2 .pow ( right ) )
1253+ result = ( left / 2 .pow ( right ) ) . floorFloat ( )
12701254 )
12711255 // Not explicitly modeled by a SimpleRangeAnalysisExpr
12721256 ) and
@@ -1475,7 +1459,7 @@ private float getUpperBoundsImpl(Expr expr) {
14751459 rsExpr = expr and
14761460 left = getFullyConvertedUpperBounds ( rsExpr .getLeftOperand ( ) ) and
14771461 right = getValue ( rsExpr .getRightOperand ( ) .getFullyConverted ( ) ) .toInt ( ) and
1478- result = safeFloor ( left / 2 .pow ( right ) )
1462+ result = ( left / 2 .pow ( right ) ) . floorFloat ( )
14791463 )
14801464 // Not explicitly modeled by a SimpleRangeAnalysisExpr
14811465 ) and
0 commit comments