| OLD | NEW |
| 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" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 } | 46 } |
| 47 | 47 |
| 48 DEFINE_NATIVE_ENTRY(Math_atan, 1) { | 48 DEFINE_NATIVE_ENTRY(Math_atan, 1) { |
| 49 GET_NATIVE_ARGUMENT(Double, operand, arguments->NativeArgAt(0)); | 49 GET_NATIVE_ARGUMENT(Double, operand, arguments->NativeArgAt(0)); |
| 50 return Double::New(atan(operand.value())); | 50 return Double::New(atan(operand.value())); |
| 51 } | 51 } |
| 52 | 52 |
| 53 DEFINE_NATIVE_ENTRY(Math_atan2, 2) { | 53 DEFINE_NATIVE_ENTRY(Math_atan2, 2) { |
| 54 GET_NATIVE_ARGUMENT(Double, operand1, arguments->NativeArgAt(0)); | 54 GET_NATIVE_ARGUMENT(Double, operand1, arguments->NativeArgAt(0)); |
| 55 GET_NATIVE_ARGUMENT(Double, operand2, arguments->NativeArgAt(1)); | 55 GET_NATIVE_ARGUMENT(Double, operand2, arguments->NativeArgAt(1)); |
| 56 return Double::New(atan2(operand1.value(), operand2.value())); | 56 return Double::New(atan2_ieee(operand1.value(), operand2.value())); |
| 57 } | 57 } |
| 58 | 58 |
| 59 DEFINE_NATIVE_ENTRY(Math_exp, 1) { | 59 DEFINE_NATIVE_ENTRY(Math_exp, 1) { |
| 60 GET_NATIVE_ARGUMENT(Double, operand, arguments->NativeArgAt(0)); | 60 GET_NATIVE_ARGUMENT(Double, operand, arguments->NativeArgAt(0)); |
| 61 return Double::New(exp(operand.value())); | 61 return Double::New(exp(operand.value())); |
| 62 } | 62 } |
| 63 | 63 |
| 64 DEFINE_NATIVE_ENTRY(Math_log, 1) { | 64 DEFINE_NATIVE_ENTRY(Math_log, 1) { |
| 65 GET_NATIVE_ARGUMENT(Double, operand, arguments->NativeArgAt(0)); | 65 GET_NATIVE_ARGUMENT(Double, operand, arguments->NativeArgAt(0)); |
| 66 return Double::New(log(operand.value())); | 66 return Double::New(log(operand.value())); |
| 67 } | 67 } |
| 68 | 68 |
| 69 } // namespace dart | 69 } // namespace dart |
| OLD | NEW |