OLD | NEW |
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 Loading... |
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 |
OLD | NEW |