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

Unified Diff: runtime/lib/math_patch.dart

Issue 22943005: Add documentation to dart:math pow function. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 7 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 | « no previous file | sdk/lib/math/math.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/math_patch.dart
diff --git a/runtime/lib/math_patch.dart b/runtime/lib/math_patch.dart
index 89460cc394afe746a87413747eebed0174879bba..f44e7b10f50879617bc9e1873b5e7b8d34dedba8 100644
--- a/runtime/lib/math_patch.dart
+++ b/runtime/lib/math_patch.dart
@@ -20,9 +20,7 @@ double _doublePow(double base, num exponent) {
if (exponent == 0) {
return 1.0; // ECMA-262 15.8.2.13
}
- if (exponent is! num) {
- throw new ArgumentError(null);
- }
+ if (base == 1.0) return 1.0;
double doubleExponent = exponent.toDouble();
if (base.isNaN || exponent.isNaN) {
return double.NAN;
« no previous file with comments | « no previous file | sdk/lib/math/math.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698