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 <math.h> | 5 #include <math.h> |
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/double_conversion.h" | 10 #include "vm/double_conversion.h" |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 } else { | 250 } else { |
251 GrowableArray<const Object*> args; | 251 GrowableArray<const Object*> args; |
252 args.Add(&String::ZoneHandle(String::New( | 252 args.Add(&String::ZoneHandle(String::New( |
253 "Illegal arguments to double.toStringAsPrecision"))); | 253 "Illegal arguments to double.toStringAsPrecision"))); |
254 Exceptions::ThrowByType(Exceptions::kArgument, args); | 254 Exceptions::ThrowByType(Exceptions::kArgument, args); |
255 return Object::null(); | 255 return Object::null(); |
256 } | 256 } |
257 } | 257 } |
258 | 258 |
259 | 259 |
260 DEFINE_NATIVE_ENTRY(Double_isInfinite, 1) { | 260 DEFINE_NATIVE_ENTRY(Double_getIsInfinite, 1) { |
261 const Double& arg = Double::CheckedHandle(arguments->At(0)); | 261 const Double& arg = Double::CheckedHandle(arguments->At(0)); |
262 return Bool::Get(isinf(arg.value())); | 262 return Bool::Get(isinf(arg.value())); |
263 } | 263 } |
264 | 264 |
265 | 265 |
266 DEFINE_NATIVE_ENTRY(Double_isNaN, 1) { | 266 DEFINE_NATIVE_ENTRY(Double_getIsNaN, 1) { |
267 const Double& arg = Double::CheckedHandle(arguments->At(0)); | 267 const Double& arg = Double::CheckedHandle(arguments->At(0)); |
268 return Bool::Get(isnan(arg.value())); | 268 return Bool::Get(isnan(arg.value())); |
269 } | 269 } |
270 | 270 |
271 | 271 |
272 DEFINE_NATIVE_ENTRY(Double_isNegative, 1) { | 272 DEFINE_NATIVE_ENTRY(Double_getIsNegative, 1) { |
273 const Double& arg = Double::CheckedHandle(arguments->At(0)); | 273 const Double& arg = Double::CheckedHandle(arguments->At(0)); |
274 // Include negative zero, infinity. | 274 // Include negative zero, infinity. |
275 return Bool::Get(signbit(arg.value()) && !isnan(arg.value())); | 275 return Bool::Get(signbit(arg.value()) && !isnan(arg.value())); |
276 } | 276 } |
277 | 277 |
278 // Add here only functions using/referring to old-style casts. | 278 // Add here only functions using/referring to old-style casts. |
279 | 279 |
280 } // namespace dart | 280 } // namespace dart |
OLD | NEW |