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

Side by Side Diff: test/unittests/base/math-unittest.cc

Issue 863633002: Use signaling NaN for holes in fixed double arrays. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Next bunch of fixes Created 5 years, 11 months 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
OLDNEW
(Empty)
1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include <limits>
6
7 #include "src/base/math.h"
8 #include "testing/gtest-support.h"
9
10 namespace v8 {
11 namespace base {
12
13 TEST(Math, IsQuietNaN) {
14 EXPECT_FALSE(IsQuietNaN(0.0f));
15 EXPECT_FALSE(IsQuietNaN(0.0));
16 EXPECT_TRUE(IsQuietNaN(std::numeric_limits<float>::quiet_NaN()));
17 EXPECT_TRUE(IsQuietNaN(std::numeric_limits<double>::quiet_NaN()));
18 EXPECT_FALSE(IsQuietNaN(std::numeric_limits<float>::signaling_NaN()));
19 EXPECT_FALSE(IsQuietNaN(std::numeric_limits<double>::signaling_NaN()));
20 EXPECT_FALSE(IsQuietNaN(std::numeric_limits<float>::infinity()));
21 EXPECT_FALSE(IsQuietNaN(std::numeric_limits<double>::infinity()));
22 }
23
24
25 TEST(Math, IsSignalingNaN) {
26 EXPECT_FALSE(IsSignalingNaN(0.0f));
27 EXPECT_FALSE(IsSignalingNaN(0.0));
28 EXPECT_TRUE(IsSignalingNaN(std::numeric_limits<float>::signaling_NaN()));
29 EXPECT_TRUE(IsSignalingNaN(std::numeric_limits<double>::signaling_NaN()));
30 EXPECT_FALSE(IsSignalingNaN(std::numeric_limits<float>::quiet_NaN()));
31 EXPECT_FALSE(IsSignalingNaN(std::numeric_limits<double>::quiet_NaN()));
32 EXPECT_FALSE(IsSignalingNaN(std::numeric_limits<float>::infinity()));
33 EXPECT_FALSE(IsSignalingNaN(std::numeric_limits<double>::infinity()));
34 }
35
36 } // namespace base
37 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698