@@ -3,10 +3,11 @@ import go
3
3
/** The constant `math.MaxInt` or the constant `math.MaxUint`. */
4
4
abstract private class MaxIntOrMaxUint extends DeclaredConstant {
5
5
/**
6
- * Gets the integer `x` such that `2.pow(x) - 1` is the value of this
7
- * constant when the architecture has bit size `architectureBitSize`.
6
+ * Gets the (binary) order of magnitude when the architecture has bit size
7
+ * `architectureBitSize`, which is defined to be the integer `x` such that
8
+ * `2.pow(x) - 1` is the value of this constant.
8
9
*/
9
- abstract int getX ( int architectureBitSize ) ;
10
+ abstract int getOrder ( int architectureBitSize ) ;
10
11
11
12
/**
12
13
* Holds if the value of this constant given `architectureBitSize` minus
@@ -15,7 +16,7 @@ abstract private class MaxIntOrMaxUint extends DeclaredConstant {
15
16
predicate isBoundFor ( int b , int architectureBitSize , float strictnessOffset ) {
16
17
// 2.pow(x) - 1 - strictnessOffset <= 2.pow(b) - 1
17
18
exists ( int x |
18
- x = this .getX ( architectureBitSize ) and
19
+ x = this .getOrder ( architectureBitSize ) and
19
20
b = validBitSize ( ) and
20
21
(
21
22
strictnessOffset = 0 and x <= b
@@ -30,7 +31,7 @@ abstract private class MaxIntOrMaxUint extends DeclaredConstant {
30
31
private class MaxInt extends MaxIntOrMaxUint {
31
32
MaxInt ( ) { this .hasQualifiedName ( "math" , "MaxInt" ) }
32
33
33
- override int getX ( int architectureBitSize ) {
34
+ override int getOrder ( int architectureBitSize ) {
34
35
architectureBitSize = [ 32 , 64 ] and result = architectureBitSize - 1
35
36
}
36
37
}
@@ -39,7 +40,7 @@ private class MaxInt extends MaxIntOrMaxUint {
39
40
private class MaxUint extends MaxIntOrMaxUint {
40
41
MaxUint ( ) { this .hasQualifiedName ( "math" , "MaxUint" ) }
41
42
42
- override int getX ( int architectureBitSize ) {
43
+ override int getOrder ( int architectureBitSize ) {
43
44
architectureBitSize = [ 32 , 64 ] and result = architectureBitSize
44
45
}
45
46
}
0 commit comments