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

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: Adding tests and updating test expectations. 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') | sdk/lib/math/math.dart » ('J')
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..72b7bfb9502ab7f153ee136e87947b15b50fcdf2 100644
--- a/runtime/lib/math_patch.dart
+++ b/runtime/lib/math_patch.dart
@@ -23,6 +23,7 @@ double _doublePow(double base, num exponent) {
if (exponent is! num) {
floitsch 2013/08/20 10:56:23 remove the check.
Lasse Reichstein Nielsen 2013/08/20 12:18:11 Done.
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') | sdk/lib/math/math.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698