| 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 */ |
| 11 class int32 implements intx { | 11 class int32 implements intx { |
| 12 | 12 |
| 13 /** | 13 /** |
| 14 * The maximum positive value attainable by an [int32], namely | 14 * The maximum positive value attainable by an [int32], namely |
| 15 * 2147483647. | 15 * 2147483647. |
| 16 */ | 16 */ |
| 17 static const int32 MAX_VALUE = const int32._internal(0x7FFFFFFF); | 17 static const int32 MAX_VALUE = const int32._internal(0x7FFFFFFF); |
| 18 | 18 |
| 19 /** | 19 /** |
| 20 * The minimum positive value attainable by an [int32], namely | 20 * The minimum positive value attainable by an [int32], namely |
| 21 * -2147483648. | 21 * -2147483648. |
| 22 */ | 22 */ |
| 23 static int32 MIN_VALUE = const int32._internal(0x80000000); | 23 static int32 MIN_VALUE = const int32._internal(-0x80000000); |
| 24 | 24 |
| 25 /** | 25 /** |
| 26 * An [int32] constant equal to 0. | 26 * An [int32] constant equal to 0. |
| 27 */ | 27 */ |
| 28 static int32 ZERO = const int32._internal(0); | 28 static int32 ZERO = const int32._internal(0); |
| 29 | 29 |
| 30 /** | 30 /** |
| 31 * An [int32] constant equal to 1. | 31 * An [int32] constant equal to 1. |
| 32 */ | 32 */ |
| 33 static int32 ONE = const int32._internal(1); | 33 static int32 ONE = const int32._internal(1); |
| (...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 347 } | 347 } |
| 348 | 348 |
| 349 int toInt() => _i; | 349 int toInt() => _i; |
| 350 int32 toInt32() => this; | 350 int32 toInt32() => this; |
| 351 int64 toInt64() => new int64.fromInt(_i); | 351 int64 toInt64() => new int64.fromInt(_i); |
| 352 | 352 |
| 353 String toString() => _i.toString(); | 353 String toString() => _i.toString(); |
| 354 String toHexString() => _i.toRadixString(16); | 354 String toHexString() => _i.toRadixString(16); |
| 355 String toRadixString(int radix) => _i.toRadixString(radix); | 355 String toRadixString(int radix) => _i.toRadixString(radix); |
| 356 } | 356 } |
| OLD | NEW |