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

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

Issue 113833002: Add num.sign getter. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Changed to return same type as the number (double for doubles, int for ints). Returns -0.0 for -0.0… Created 7 years 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 part of dart.core; 5 part of dart.core;
6 6
7 /** 7 /**
8 * An arbitrarily large integer. 8 * An arbitrarily large integer.
9 * 9 *
10 * **Note:** When compiling to JavaScript, integers are 10 * **Note:** When compiling to JavaScript, integers are
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 */ 189 */
190 int operator -(); 190 int operator -();
191 191
192 /** 192 /**
193 * Returns the absolute value of this integer. 193 * Returns the absolute value of this integer.
194 * 194 *
195 * For any integer `x`, the result is the same as `x < 0 ? -x : x`. 195 * For any integer `x`, the result is the same as `x < 0 ? -x : x`.
196 */ 196 */
197 int abs(); 197 int abs();
198 198
199 /**
200 * Returns the sign of this integer.
201 *
202 * Returns 0 for zero, -1 for values less than zero and
203 * +1 for values greater than zero.
204 */
205 int get sign;
206
199 /** Returns `this`. */ 207 /** Returns `this`. */
200 int round(); 208 int round();
201 209
202 /** Returns `this`. */ 210 /** Returns `this`. */
203 int floor(); 211 int floor();
204 212
205 /** Returns `this`. */ 213 /** Returns `this`. */
206 int ceil(); 214 int ceil();
207 215
208 /** Returns `this`. */ 216 /** Returns `this`. */
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 * value is used instead. If no [onError] is provided, a [FormatException] 269 * value is used instead. If no [onError] is provided, a [FormatException]
262 * is thrown. 270 * is thrown.
263 * 271 *
264 * The [onError] function is only invoked if [source] is a [String]. It is 272 * The [onError] function is only invoked if [source] is a [String]. It is
265 * not invoked if the [source] is, for example, `null`. 273 * not invoked if the [source] is, for example, `null`.
266 */ 274 */
267 external static int parse(String source, 275 external static int parse(String source,
268 { int radix, 276 { int radix,
269 int onError(String source) }); 277 int onError(String source) });
270 } 278 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698