Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(243)

Side by Side Diff: lib/core/int.dart

Issue 11227042: isEven, isOdd, isNegative, isMaxValue, isMinValue, isInfinite, isPositive, isSingleValue. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebase. Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 /** 5 /**
6 * Representation of Dart integers containing integer specific 6 * Representation of Dart integers containing integer specific
7 * operations and specialization of operations inherited from [num]. 7 * operations and specialization of operations inherited from [num].
8 * 8 *
9 * Integers can be arbitrarily large in Dart. 9 * Integers can be arbitrarily large in Dart.
10 * 10 *
(...skipping 18 matching lines...) Expand all
29 /** The bit-wise negate operator. */ 29 /** The bit-wise negate operator. */
30 int operator ~(); 30 int operator ~();
31 31
32 /** The left shift operator. */ 32 /** The left shift operator. */
33 int operator <<(int shiftAmount); 33 int operator <<(int shiftAmount);
34 34
35 /** The right shift operator. */ 35 /** The right shift operator. */
36 int operator >>(int shiftAmount); 36 int operator >>(int shiftAmount);
37 37
38 /** Returns true if and only if this integer is even. */ 38 /** Returns true if and only if this integer is even. */
39 bool isEven(); 39 bool get isEven;
40 40
41 /** Returns true if and only if this integer is odd. */ 41 /** Returns true if and only if this integer is odd. */
42 bool isOdd(); 42 bool get isOdd;
43 43
44 /** Negate operator. Negating an integer produces an integer. */ 44 /** Negate operator. Negating an integer produces an integer. */
45 int operator -(); 45 int operator -();
46 46
47 /** Returns the absolute value of this integer. */ 47 /** Returns the absolute value of this integer. */
48 int abs(); 48 int abs();
49 49
50 /** For integers the round method is the identify function. */ 50 /** For integers the round method is the identify function. */
srdjan 2012/10/23 21:09:42 What does 'identify' means in this context?
floitsch 2012/10/24 07:49:20 thanks. https://codereview.chromium.org/11275002/
51 int round(); 51 int round();
52 52
53 /** For integers the floor method is the identify function. */ 53 /** For integers the floor method is the identify function. */
54 int floor(); 54 int floor();
55 55
56 /** For integers the ceil method is the identify function. */ 56 /** For integers the ceil method is the identify function. */
57 int ceil(); 57 int ceil();
58 58
59 /** For integers the truncate method is the identify function. */ 59 /** For integers the truncate method is the identify function. */
60 int truncate(); 60 int truncate();
61 61
62 /** 62 /**
63 * Returns a representation of this [int] value. 63 * Returns a representation of this [int] value.
64 * 64 *
65 * It should always be the case that if [:i:] is an [int] value, 65 * It should always be the case that if [:i:] is an [int] value,
66 * then [:i == int.parse(i.toString()):]. 66 * then [:i == int.parse(i.toString()):].
67 */ 67 */
68 String toString(); 68 String toString();
69 69
70 /** 70 /**
71 * Parse [source] as an integer literal and return its value. 71 * Parse [source] as an integer literal and return its value.
72 * 72 *
73 * Accepts "0x" prefix for hexadecimal numbers, otherwise defaults 73 * Accepts "0x" prefix for hexadecimal numbers, otherwise defaults
74 * to base-10. 74 * to base-10.
75 * 75 *
76 * Throws a [FormatException] if [source] is not a valid integer literal. 76 * Throws a [FormatException] if [source] is not a valid integer literal.
77 */ 77 */
78 external static int parse(String source); 78 external static int parse(String source);
79 } 79 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698