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

Side by Side Diff: tests/lib/math/math_package_bigint_test.dart

Issue 475463005: Implement math.gcd in dart. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Move gcd to pkg/math; move tests; fix implementation; split bigint tests Created 6 years, 4 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
OLDNEW
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4
5 library math_test;
6 import "package:expect/expect.dart";
7 import 'dart:math';
8 import 'package:math/math.dart';
Lasse Reichstein Nielsen 2014/08/20 12:17:02 Test of package functionality should go in the pac
srawlins 2014/08/25 05:43:54 Done.
9
10 // See math_package_test.dart first. This file contains only the tests that
11 // need Bigint or would fail in dart2js compatibility mode.
12
13 class MathPackageBigintTest {
Lasse Reichstein Nielsen 2014/08/20 12:17:02 No need for a class here, or a testMain method, ju
srawlins 2014/08/25 05:43:54 Done.
14 static void testGcdWithBigints() {
15 Expect.equals(pow(2, 63)*3, gcd(pow(2, 64)*3*5, pow(2,63)*3*7));
16 // 595056260442243647 is the first prime after 2**64 / 31.
17 Expect.equals(595056260442243647,
18 gcd(31*595056260442243647, 37*595056260442243647));
19 }
20
21 static testMain() {
22 testGcdWithBigints();
23 }
24 }
25
26 main() {
27 MathPackageBigintTest.testMain();
28 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698