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

Unified Diff: runtime/lib/bigint.dart

Issue 2005723004: Fraction class prototype and test (not to be committed). (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: work in progress Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | runtime/lib/core_sources.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/bigint.dart
diff --git a/runtime/lib/bigint.dart b/runtime/lib/bigint.dart
index 0c562d7b730e9b3e9e4649a9636aa8d1252454cf..36a0314870bbc321a3a840d864e1d9175b740630 100644
--- a/runtime/lib/bigint.dart
+++ b/runtime/lib/bigint.dart
@@ -1259,34 +1259,34 @@ class _Bigint extends _IntegerImplementation implements int {
// efficiency, but are not necessary for correctness. They shortcut native
// calls that would return null because the receiver is _Bigint.
num operator +(num other) {
- return other._toBigintOrDouble()._addFromInteger(this);
+ return other._toBigintIfInteger()._addFromInteger(this);
}
num operator -(num other) {
- return other._toBigintOrDouble()._subFromInteger(this);
+ return other._toBigintIfInteger()._subFromInteger(this);
}
num operator *(num other) {
- return other._toBigintOrDouble()._mulFromInteger(this);
+ return other._toBigintIfInteger()._mulFromInteger(this);
}
num operator ~/(num other) {
- return other._toBigintOrDouble()._truncDivFromInteger(this);
+ return other._toBigintIfInteger()._truncDivFromInteger(this);
}
num operator %(num other) {
- return other._toBigintOrDouble()._moduloFromInteger(this);
+ return other._toBigintIfInteger()._moduloFromInteger(this);
}
int operator &(int other) {
- return other._toBigintOrDouble()._bitAndFromInteger(this);
+ return other._toBigintIfInteger()._bitAndFromInteger(this);
}
int operator |(int other) {
- return other._toBigintOrDouble()._bitOrFromInteger(this);
+ return other._toBigintIfInteger()._bitOrFromInteger(this);
}
int operator ^(int other) {
- return other._toBigintOrDouble()._bitXorFromInteger(this);
+ return other._toBigintIfInteger()._bitXorFromInteger(this);
}
int operator >>(int other) {
- return other._toBigintOrDouble()._shrFromInt(this);
+ return other._toBigintIfInteger()._shrFromInt(this);
}
int operator <<(int other) {
- return other._toBigintOrDouble()._shlFromInt(this);
+ return other._toBigintIfInteger()._shlFromInt(this);
}
// End of operator shortcuts.
« no previous file with comments | « no previous file | runtime/lib/core_sources.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698