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 dart.core; | 5 part of dart.core; |
6 | 6 |
7 /** | 7 /** |
8 * An integer or floating-point number. | 8 * An integer or floating-point number. |
9 * | 9 * |
10 * It is a compile-time error for any type other than [int] or [double] | 10 * It is a compile-time error for any type other than [int] or [double] |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 * No guarantees are made about the hash code of NaN values. | 54 * No guarantees are made about the hash code of NaN values. |
55 */ | 55 */ |
56 int get hashCode; | 56 int get hashCode; |
57 | 57 |
58 /** | 58 /** |
59 * Compares this to `other`. | 59 * Compares this to `other`. |
60 * | 60 * |
61 * Returns a negative number if `this` is less than `other`, zero if they are | 61 * Returns a negative number if `this` is less than `other`, zero if they are |
62 * equal, and a positive number if `this` is greater than `other`. | 62 * equal, and a positive number if `this` is greater than `other`. |
63 * | 63 * |
64 * The orderding represented by this method is a total ordering of [num] | 64 * The ordering represented by this method is a total ordering of [num] |
65 * values. All distinct doubles are non-equal, as are all distinct integers, | 65 * values. All distinct doubles are non-equal, as are all distinct integers, |
66 * but integers are equal to doubles if they have the same numerical | 66 * but integers are equal to doubles if they have the same numerical |
67 * value. | 67 * value. |
68 * | 68 * |
69 * For doubles, the `compareTo` operation is different from the partial | 69 * For doubles, the `compareTo` operation is different from the partial |
70 * ordering given by [operator==], [operator<] and [operator>]. For example, | 70 * ordering given by [operator==], [operator<] and [operator>]. For example, |
71 * IEEE doubles impose that `0.0 == -0.0` and all comparison operations on | 71 * IEEE doubles impose that `0.0 == -0.0` and all comparison operations on |
72 * NaN return false. | 72 * NaN return false. |
73 * | 73 * |
74 * This function imposes a complete ordering for doubles. When using | 74 * This function imposes a complete ordering for doubles. When using |
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
471 result = double.parse(source, _returnDoubleNull); | 471 result = double.parse(source, _returnDoubleNull); |
472 if (result != null) return result; | 472 if (result != null) return result; |
473 if (onError == null) throw new FormatException(input); | 473 if (onError == null) throw new FormatException(input); |
474 return onError(input); | 474 return onError(input); |
475 } | 475 } |
476 | 476 |
477 /** Helper functions for [parse]. */ | 477 /** Helper functions for [parse]. */ |
478 static int _returnIntNull(String _) => null; | 478 static int _returnIntNull(String _) => null; |
479 static double _returnDoubleNull(String _) => null; | 479 static double _returnDoubleNull(String _) => null; |
480 } | 480 } |
OLD | NEW |