OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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 // Check all examples from table 10-1 of "Hacker's Delight". | 5 // Check all examples from table 10-1 of "Hacker's Delight". |
6 | 6 |
7 #include "src/base/division-by-constant.h" | 7 #include "src/base/division-by-constant.h" |
8 | 8 |
9 #include <ostream> // NOLINT | 9 #include <ostream> // NOLINT |
10 | 10 |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 EXPECT_EQ(M64(0xCCCCCCCCCCCCCCCDULL, 3, false), u64(10)); | 123 EXPECT_EQ(M64(0xCCCCCCCCCCCCCCCDULL, 3, false), u64(10)); |
124 EXPECT_EQ(M64(0x2E8BA2E8BA2E8BA3ULL, 1, false), u64(11)); | 124 EXPECT_EQ(M64(0x2E8BA2E8BA2E8BA3ULL, 1, false), u64(11)); |
125 EXPECT_EQ(M64(0xAAAAAAAAAAAAAAABULL, 3, false), u64(12)); | 125 EXPECT_EQ(M64(0xAAAAAAAAAAAAAAABULL, 3, false), u64(12)); |
126 EXPECT_EQ(M64(0x47AE147AE147AE15ULL, 5, true), u64(25)); | 126 EXPECT_EQ(M64(0x47AE147AE147AE15ULL, 5, true), u64(25)); |
127 EXPECT_EQ(M64(0x0624DD2F1A9FBE77ULL, 7, true), u64(125)); | 127 EXPECT_EQ(M64(0x0624DD2F1A9FBE77ULL, 7, true), u64(125)); |
128 EXPECT_EQ(M64(0x346DC5D63886594BULL, 7, false), u64(625)); | 128 EXPECT_EQ(M64(0x346DC5D63886594BULL, 7, false), u64(625)); |
129 } | 129 } |
130 | 130 |
131 } // namespace base | 131 } // namespace base |
132 } // namespace v8 | 132 } // namespace v8 |
OLD | NEW |