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

Side by Side Diff: frog/lib/num.dart

Issue 8457007: Better runtime type checks. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merged, and fix typo in member name Created 9 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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 // Dart core library. 5 // Dart core library.
6 6
7 interface num extends Comparable, Hashable { 7 interface num extends Comparable, Hashable {
8 // Arithmetic operations. 8 // Arithmetic operations.
9 num operator +(num other); 9 num operator +(num other);
10 num operator -(num other); 10 num operator -(num other);
(...skipping 26 matching lines...) Expand all
37 num truncate(); 37 num truncate();
38 38
39 int toInt(); 39 int toInt();
40 double toDouble(); 40 double toDouble();
41 41
42 String toStringAsFixed(int fractionDigits); 42 String toStringAsFixed(int fractionDigits);
43 String toStringAsExponential(int fractionDigits); 43 String toStringAsExponential(int fractionDigits);
44 String toStringAsPrecision(int precision); 44 String toStringAsPrecision(int precision);
45 String toRadixString(int radix); 45 String toRadixString(int radix);
46 46
47 // TODO(jmesserly): we need to do something in the Frog type system to know
48 // to know that most int operations are closed over integers.
49
47 // TODO(jimhug): Bit-operations stolen from int 50 // TODO(jimhug): Bit-operations stolen from int
48 int operator &(int other); 51 int operator &(int other);
49 int operator |(int other); 52 int operator |(int other);
50 int operator ^(int other); 53 int operator ^(int other);
51 int operator ~(); 54 int operator ~();
52 int operator <<(int shiftAmount); 55 int operator <<(int shiftAmount);
53 int operator >>(int shiftAmount); 56 int operator >>(int shiftAmount);
54 57
55 // bit operation missing in corelib? 58 // bit operation missing in corelib?
56 int operator >>>(int shiftAmount); 59 int operator >>>(int shiftAmount);
57 } 60 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698