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

Side by Side Diff: runtime/lib/math.cc

Issue 11417049: - Remove obsolete random number generator from the VM code. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 1 month 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
« no previous file with comments | « no previous file | runtime/vm/bootstrap_natives.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 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 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. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include <ctype.h> // isspace. 5 #include <ctype.h> // isspace.
6 6
7 #include "vm/bootstrap_natives.h" 7 #include "vm/bootstrap_natives.h"
8 8
9 #include "vm/bigint_operations.h" 9 #include "vm/bigint_operations.h"
10 #include "vm/exceptions.h" 10 #include "vm/exceptions.h"
11 #include "vm/native_entry.h" 11 #include "vm/native_entry.h"
12 #include "vm/object.h" 12 #include "vm/object.h"
13 #include "vm/random.h"
14 #include "vm/scanner.h" 13 #include "vm/scanner.h"
15 #include "vm/symbols.h" 14 #include "vm/symbols.h"
16 15
17 namespace dart { 16 namespace dart {
18 17
19 DEFINE_NATIVE_ENTRY(Math_sqrt, 1) { 18 DEFINE_NATIVE_ENTRY(Math_sqrt, 1) {
20 GET_NATIVE_ARGUMENT(Double, operand, arguments->NativeArgAt(0)); 19 GET_NATIVE_ARGUMENT(Double, operand, arguments->NativeArgAt(0));
21 return Double::New(sqrt(operand.value())); 20 return Double::New(sqrt(operand.value()));
22 } 21 }
23 22
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 DEFINE_NATIVE_ENTRY(Math_exp, 1) { 59 DEFINE_NATIVE_ENTRY(Math_exp, 1) {
61 GET_NATIVE_ARGUMENT(Double, operand, arguments->NativeArgAt(0)); 60 GET_NATIVE_ARGUMENT(Double, operand, arguments->NativeArgAt(0));
62 return Double::New(exp(operand.value())); 61 return Double::New(exp(operand.value()));
63 } 62 }
64 63
65 DEFINE_NATIVE_ENTRY(Math_log, 1) { 64 DEFINE_NATIVE_ENTRY(Math_log, 1) {
66 GET_NATIVE_ARGUMENT(Double, operand, arguments->NativeArgAt(0)); 65 GET_NATIVE_ARGUMENT(Double, operand, arguments->NativeArgAt(0));
67 return Double::New(log(operand.value())); 66 return Double::New(log(operand.value()));
68 } 67 }
69 68
70 DEFINE_NATIVE_ENTRY(Math_random, 0) {
71 return Double::New(static_cast<double>(Random::RandomInt32()-1)/0x80000000);
72 }
73
74 } // namespace dart 69 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/bootstrap_natives.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698