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

Unified Diff: runtime/lib/math.cc

Issue 23129005: Remove int.pow and double.pow from VM library. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fixed Math.pow to not use int.pow,double.pow. 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 | « runtime/lib/integers.dart ('k') | runtime/lib/math_patch.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/math.cc
diff --git a/runtime/lib/math.cc b/runtime/lib/math.cc
index 317045dce5b1cf1c278e06a7c862a619f995f803..ca7c7e6da90d04f2ee8a60443505c68ec697b3c5 100644
--- a/runtime/lib/math.cc
+++ b/runtime/lib/math.cc
@@ -66,6 +66,15 @@ DEFINE_NATIVE_ENTRY(Math_log, 1) {
return Double::New(log(operand.value()));
}
+DEFINE_NATIVE_ENTRY(Math_doublePow, 2) {
+ const double operand =
+ Double::CheckedHandle(arguments->NativeArgAt(0)).value();
+ GET_NON_NULL_NATIVE_ARGUMENT(
+ Double, exponent_object, arguments->NativeArgAt(1));
+ const double exponent = exponent_object.value();
+ return Double::New(pow(operand, exponent));
+}
+
// Returns the typed-data array store in '_Random._state' field.
static RawTypedData* GetRandomStateArray(const Instance& receiver) {
« no previous file with comments | « runtime/lib/integers.dart ('k') | runtime/lib/math_patch.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698