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

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

Issue 12317107: ceil/floor/truncate/round return integers. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Reupload due to error3 Created 7 years, 9 months 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
« no previous file with comments | « sdk/lib/core/double.dart ('k') | sdk/lib/core/num.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 part of dart.core; 5 part of dart.core;
6 6
7 /** 7 /**
8 * Representation of Dart integers containing integer specific 8 * Representation of Dart integers containing integer specific
9 * operations and specialization of operations inherited from [num]. 9 * operations and specialization of operations inherited from [num].
10 * 10 *
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 42
43 /** Returns true if and only if this integer is odd. */ 43 /** Returns true if and only if this integer is odd. */
44 bool get isOdd; 44 bool get isOdd;
45 45
46 /** Negate operator. Negating an integer produces an integer. */ 46 /** Negate operator. Negating an integer produces an integer. */
47 int operator -(); 47 int operator -();
48 48
49 /** Returns the absolute value of this integer. */ 49 /** Returns the absolute value of this integer. */
50 int abs(); 50 int abs();
51 51
52 /** Returns [this]. */ 52 /** Returns `this`. */
53 int round(); 53 int round();
54 54
55 /** Returns [this]. */ 55 /** Returns `this`. */
56 int floor(); 56 int floor();
57 57
58 /** Returns [this]. */ 58 /** Returns [this]. */
59 int ceil(); 59 int ceil();
60 60
61 /** Returns [this]. */ 61 /** Returns [this]. */
62 int truncate(); 62 int truncate();
63 63
64 /** Returns `this.toDouble()`. */
65 double roundToDouble();
66
67 /** Returns `this.toDouble()`. */
68 double floorToDouble();
69
70 /** Returns `this.toDouble()`. */
71 double ceilToDouble();
72
73 /** Returns `this.toDouble()`. */
74 double truncateToDouble();
75
64 /** 76 /**
65 * Returns a representation of this [int] value. 77 * Returns a representation of this [int] value.
66 * 78 *
67 * It should always be the case that if [:i:] is an [int] value, 79 * It should always be the case that if [:i:] is an [int] value,
68 * then [:i == int.parse(i.toString()):]. 80 * then [:i == int.parse(i.toString()):].
69 */ 81 */
70 String toString(); 82 String toString();
71 83
72 /** 84 /**
73 * Converts [this] to a string representation in the given [radix]. 85 * Converts [this] to a string representation in the given [radix].
(...skipping 23 matching lines...) Expand all
97 * 109 *
98 * If the [source] is not a valid integer literal, optionally prefixed by a 110 * If the [source] is not a valid integer literal, optionally prefixed by a
99 * sign, the [onError] is called with the [source] as argument, and its return 111 * sign, the [onError] is called with the [source] as argument, and its return
100 * value is used instead. If no [onError] is provided, a [FormatException] 112 * value is used instead. If no [onError] is provided, a [FormatException]
101 * is thrown. 113 * is thrown.
102 */ 114 */
103 external static int parse(String source, 115 external static int parse(String source,
104 { int radix, 116 { int radix,
105 int onError(String source) }); 117 int onError(String source) });
106 } 118 }
OLDNEW
« no previous file with comments | « sdk/lib/core/double.dart ('k') | sdk/lib/core/num.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698