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

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

Issue 2071823002: [Math builtins]: Cleanup in ieee754, restoring MSUN version of log2(). (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 6 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
« src/base/ieee754.cc ('K') | « src/base/ieee754.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <limits> 5 #include <limits>
6 6
7 #include "src/base/ieee754.h" 7 #include "src/base/ieee754.h"
8 #include "src/base/macros.h" 8 #include "src/base/macros.h"
9 #include "testing/gmock-support.h" 9 #include "testing/gmock-support.h"
10 #include "testing/gtest-support.h" 10 #include "testing/gtest-support.h"
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 EXPECT_THAT(log10(-1.0), IsNaN()); 126 EXPECT_THAT(log10(-1.0), IsNaN());
127 EXPECT_EQ(-std::numeric_limits<double>::infinity(), log10(0.0)); 127 EXPECT_EQ(-std::numeric_limits<double>::infinity(), log10(0.0));
128 EXPECT_EQ(-std::numeric_limits<double>::infinity(), log10(-0.0)); 128 EXPECT_EQ(-std::numeric_limits<double>::infinity(), log10(-0.0));
129 EXPECT_EQ(std::numeric_limits<double>::infinity(), 129 EXPECT_EQ(std::numeric_limits<double>::infinity(),
130 log10(std::numeric_limits<double>::infinity())); 130 log10(std::numeric_limits<double>::infinity()));
131 EXPECT_EQ(3.0, log10(1000.0)); 131 EXPECT_EQ(3.0, log10(1000.0));
132 EXPECT_EQ(14.0, log10(100000000000000)); // log10(10 ^ 14) 132 EXPECT_EQ(14.0, log10(100000000000000)); // log10(10 ^ 14)
133 EXPECT_EQ(3.7389561269540406, log10(5482.2158)); 133 EXPECT_EQ(3.7389561269540406, log10(5482.2158));
134 EXPECT_EQ(14.661551142893833, log10(458723662312872.125782332587)); 134 EXPECT_EQ(14.661551142893833, log10(458723662312872.125782332587));
135 EXPECT_EQ(-0.9083828622192334, log10(0.12348583358871)); 135 EXPECT_EQ(-0.9083828622192334, log10(0.12348583358871));
136 EXPECT_EQ(5.0, log10(100000.0));
136 } 137 }
137 138
138 } // namespace ieee754 139 } // namespace ieee754
139 } // namespace base 140 } // namespace base
140 } // namespace v8 141 } // namespace v8
OLDNEW
« src/base/ieee754.cc ('K') | « src/base/ieee754.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698