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

Unified Diff: sdk/lib/core/int.dart

Issue 1199513003: Implement gcd in sdk. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 6 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 | « sdk/lib/_internal/compiler/js_lib/js_number.dart ('k') | tests/corelib/big_integer_arith_vm_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/core/int.dart
diff --git a/sdk/lib/core/int.dart b/sdk/lib/core/int.dart
index 5aee609939f14f46497c169812cd6ef6065dcc08..58d80b84607f5eec6965c1030ef417f6f4cc6cd5 100644
--- a/sdk/lib/core/int.dart
+++ b/sdk/lib/core/int.dart
@@ -120,6 +120,14 @@ abstract class int extends num {
*/
int modInverse(int modulus);
+ /**
+ * Returns the greatest common divisor of the absolute value of
+ * this integer and the absolute value of [other].
+ *
+ * Both this and [other] must be non-zero.
+ */
+ int gcd(int other);
+
/** Returns true if and only if this integer is even. */
bool get isEven;
« no previous file with comments | « sdk/lib/_internal/compiler/js_lib/js_number.dart ('k') | tests/corelib/big_integer_arith_vm_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698