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

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

Issue 11227042: isEven, isOdd, isNegative, isMaxValue, isMinValue, isInfinite, isPositive, isSingleValue. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebase. 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
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 <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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698