| 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; | 5 part of fixnum; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * An immutable 32-bit signed integer, in the range [-2^31, 2^31 - 1]. | 8 * An immutable 32-bit signed integer, in the range [-2^31, 2^31 - 1]. |
| 9 * Arithmetic operations may overflow in order to maintain this range. | 9 * Arithmetic operations may overflow in order to maintain this range. |
| 10 */ | 10 */ |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 if (other is Int32) { | 277 if (other is Int32) { |
| 278 return _i == other._i; | 278 return _i == other._i; |
| 279 } else if (other is Int64) { | 279 } else if (other is Int64) { |
| 280 return this.toInt64() == other; | 280 return this.toInt64() == other; |
| 281 } else if (other is int) { | 281 } else if (other is int) { |
| 282 return _i == other; | 282 return _i == other; |
| 283 } | 283 } |
| 284 return false; | 284 return false; |
| 285 } | 285 } |
| 286 | 286 |
| 287 int compareTo(Comparable other) { | 287 int compareTo(IntX other) { |
| 288 if (other is Int64) { | 288 if (other is Int64) { |
| 289 return this.toInt64().compareTo(other); | 289 return this.toInt64().compareTo(other); |
| 290 } | 290 } |
| 291 return _i.compareTo(_toInt(other)); | 291 return _i.compareTo(_toInt(other)); |
| 292 } | 292 } |
| 293 | 293 |
| 294 bool operator <(other) { | 294 bool operator <(other) { |
| 295 if (other is Int64) { | 295 if (other is Int64) { |
| 296 return this.toInt64() < other; | 296 return this.toInt64() < other; |
| 297 } | 297 } |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 368 | 368 |
| 369 double toDouble() => _i.toDouble(); | 369 double toDouble() => _i.toDouble(); |
| 370 int toInt() => _i; | 370 int toInt() => _i; |
| 371 Int32 toInt32() => this; | 371 Int32 toInt32() => this; |
| 372 Int64 toInt64() => new Int64(_i); | 372 Int64 toInt64() => new Int64(_i); |
| 373 | 373 |
| 374 String toString() => _i.toString(); | 374 String toString() => _i.toString(); |
| 375 String toHexString() => _i.toRadixString(16); | 375 String toHexString() => _i.toRadixString(16); |
| 376 String toRadixString(int radix) => _i.toRadixString(radix); | 376 String toRadixString(int radix) => _i.toRadixString(radix); |
| 377 } | 377 } |
| OLD | NEW |