OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
| 5 part of fixnum; |
| 6 |
5 /** | 7 /** |
6 * An immutable 64-bit signed integer, in the range [-2^63, 2^63 - 1]. | 8 * An immutable 64-bit signed integer, in the range [-2^63, 2^63 - 1]. |
7 * Arithmetic operations may overflow in order to maintain this range. | 9 * Arithmetic operations may overflow in order to maintain this range. |
8 */ | 10 */ |
9 class int64 implements intx { | 11 class int64 implements intx { |
10 | 12 |
11 // A 64-bit integer is represented internally as three non-negative | 13 // A 64-bit integer is represented internally as three non-negative |
12 // integers, storing the 22 low, 22 middle, and 20 high bits of the | 14 // integers, storing the 22 low, 22 middle, and 20 high bits of the |
13 // 64-bit value. _l (low) and _m (middle) are in the range | 15 // 64-bit value. _l (low) and _m (middle) are in the range |
14 // [0, 2^22 - 1] and _h (high) is in the range [0, 2^20 - 1]. | 16 // [0, 2^22 - 1] and _h (high) is in the range [0, 2^20 - 1]. |
(...skipping 1071 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1086 } | 1088 } |
1087 } | 1089 } |
1088 return ZERO; | 1090 return ZERO; |
1089 } | 1091 } |
1090 | 1092 |
1091 // Generate the quotient using bit-at-a-time long division. | 1093 // Generate the quotient using bit-at-a-time long division. |
1092 return _divModHelper(aIsCopy ? a : new int64._copy(a), b, negative, | 1094 return _divModHelper(aIsCopy ? a : new int64._copy(a), b, negative, |
1093 aIsNegative, aIsMinValue, computeRemainder); | 1095 aIsNegative, aIsMinValue, computeRemainder); |
1094 } | 1096 } |
1095 } | 1097 } |
OLD | NEW |