equal
deleted
inserted
replaced
1120 "Created: / 6.6.1999 / 15:00:40 / cg" |
1120 "Created: / 6.6.1999 / 15:00:40 / cg" |
1121 ! |
1121 ! |
1122 |
1122 |
1123 highBit |
1123 highBit |
1124 "return the bitIndex of the highest bit set. The returned bitIndex |
1124 "return the bitIndex of the highest bit set. The returned bitIndex |
1125 starts at 1 for the least significant bit. Returns -1 if no bit is set." |
1125 starts at 1 for the least significant bit. |
|
1126 Returns 0 if no bit is set." |
1126 |
1127 |
1127 |byteNr highByte| |
1128 |byteNr highByte| |
1128 |
1129 |
1129 byteNr := self digitLength. |
1130 byteNr := self digitLength. |
1130 byteNr == 0 ifTrue:[ |
1131 byteNr == 0 ifTrue:[ |
1131 ^ -1 |
1132 ^ 0 |
1132 ]. |
1133 ]. |
1133 highByte := self digitAt:byteNr. |
1134 highByte := self digitAt:byteNr. |
1134 ^ (byteNr - 1) * 8 + highByte highBit |
1135 ^ (byteNr - 1) * 8 + highByte highBit |
1135 |
1136 |
1136 " |
1137 " |
2759 ! ! |
2760 ! ! |
2760 |
2761 |
2761 !Integer class methodsFor:'documentation'! |
2762 !Integer class methodsFor:'documentation'! |
2762 |
2763 |
2763 version |
2764 version |
2764 ^ '$Header: /cvs/stx/stx/libbasic/Integer.st,v 1.143 2002-03-28 10:50:10 cg Exp $' |
2765 ^ '$Header: /cvs/stx/stx/libbasic/Integer.st,v 1.144 2002-03-28 11:02:13 cg Exp $' |
2765 ! ! |
2766 ! ! |
2766 Integer initialize! |
2767 Integer initialize! |