Chromium Code Reviews| Index: runtime/lib/double.cc |
| diff --git a/runtime/lib/double.cc b/runtime/lib/double.cc |
| index 4173c1403d034ad917f12dea13d7f23cd2fc1f4b..6771bfa2b229f0a19bceaed46b176d8dde6f5145 100644 |
| --- a/runtime/lib/double.cc |
| +++ b/runtime/lib/double.cc |
| @@ -300,6 +300,19 @@ DEFINE_NATIVE_ENTRY(Double_getIsNegative, 1) { |
| return Bool::Get(signbit(dval) && !isnan(dval)).raw(); |
| } |
| + |
| +DEFINE_NATIVE_ENTRY(Double_flipNANsign, 1) { |
| + const Double& arg = Double::CheckedHandle(arguments->NativeArgAt(0)); |
| + ASSERT(isnan(arg.value())); |
| + double res; |
| + if (signbit(arg.value()) == 1) { |
| + res = NAN; |
|
koda
2015/06/02 21:20:57
Here, you are also normalizing to a particular NAN
srdjan
2015/06/02 22:32:10
Renamed method to Double_flipSignBit. Flipping sig
|
| + } else { |
| + res = -NAN; |
| + } |
| + return Double::New(res); |
| +} |
| + |
| // Add here only functions using/referring to old-style casts. |
| } // namespace dart |