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

Unified Diff: lib/math/base.dart

Issue 10831324: Cleanup of math sources. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Another attempt Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/compiler/implementation/library_map.dart ('k') | lib/math/math.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/math/base.dart
diff --git a/lib/math/base.dart b/lib/math/base.dart
index ac878b7f67d34cecb20a5d23af59d32e27ee78f4..926c17a5ef5a039a5ed7aec917fd40ebfcfe50eb 100644
--- a/lib/math/base.dart
+++ b/lib/math/base.dart
@@ -48,13 +48,13 @@ final double SQRT2 = 1.4142135623730951;
* Parses a [String] representation of an [int], and returns an [int]. Throws a
* [FormatException] if [str] cannot be parsed as an [int].
*/
-int parseInt(String str) => MathNatives.parseInt(str);
+external int parseInt(String str);
/**
* Parses a [String] representation of a [double], and returns a [double].
* Throws a [FormatException] if [str] cannot be parsed as a [double].
*/
-double parseDouble(String str) => MathNatives.parseDouble(str);
+external double parseDouble(String str);
/**
* Returns the minimum of two numbers. If either argument is NaN returns NaN.
@@ -81,7 +81,7 @@ num min(num a, num b) {
}
}
// Check for NaN and b == -0.0.
- if (a == 0 && b.isNegative() || b.isNan()) return b;
+ if (a == 0 && b.isNegative() || b.isNaN()) return b;
return a;
}
return a;
@@ -131,20 +131,21 @@ num max(num a, num b) {
/**
* Returns the arc tangent of [a]/[b] with sign according to quadrant.
*/
-double atan2(num a, num b) => MathNatives.atan2(a, b);
+external double atan2(num a, num b);
/**
* If the [exponent] is an integer the result is of the same type as [x].
* Otherwise it is a [double].
*/
-num pow(num x, num exponent) => MathNatives.pow(x, exponent);
-
-double sin(num x) => MathNatives.sin(x);
-double cos(num x) => MathNatives.cos(x);
-double tan(num x) => MathNatives.tan(x);
-double acos(num x) => MathNatives.acos(x);
-double asin(num x) => MathNatives.asin(x);
-double atan(num x) => MathNatives.atan(x);
-double sqrt(num x) => MathNatives.sqrt(x);
-double exp(num x) => MathNatives.exp(x);
-double log(num x) => MathNatives.log(x);
+external num pow(num x, num exponent);
+
+// TODO(4512): Add documentation.
+external double sin(num x);
+external double cos(num x);
+external double tan(num x);
+external double acos(num x);
+external double asin(num x);
+external double atan(num x);
+external double sqrt(num x);
+external double exp(num x);
+external double log(num x);
« no previous file with comments | « lib/compiler/implementation/library_map.dart ('k') | lib/math/math.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698