be/src/exec/common/int_exp.h
Line | Count | Source |
1 | | // Licensed to the Apache Software Foundation (ASF) under one |
2 | | // or more contributor license agreements. See the NOTICE file |
3 | | // distributed with this work for additional information |
4 | | // regarding copyright ownership. The ASF licenses this file |
5 | | // to you under the Apache License, Version 2.0 (the |
6 | | // "License"); you may not use this file except in compliance |
7 | | // with the License. You may obtain a copy of the License at |
8 | | // |
9 | | // http://www.apache.org/licenses/LICENSE-2.0 |
10 | | // |
11 | | // Unless required by applicable law or agreed to in writing, |
12 | | // software distributed under the License is distributed on an |
13 | | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
14 | | // KIND, either express or implied. See the License for the |
15 | | // specific language governing permissions and limitations |
16 | | // under the License. |
17 | | // This file is copied from |
18 | | // https://github.com/ClickHouse/ClickHouse/blob/master/src/Common/IntExp.h |
19 | | // and modified by Doris |
20 | | |
21 | | #pragma once |
22 | | |
23 | | #include <cstdint> |
24 | | #include <limits> |
25 | | #include <utility> |
26 | | |
27 | | #include "core/extended_types.h" |
28 | | |
29 | | namespace exp_details { |
30 | | |
31 | | // compile-time exp(v, n) by linear recursion |
32 | | template <typename T, T v, std::size_t n> |
33 | | constexpr inline const T exp = T(v) * exp<T, v, n - 1>; |
34 | | |
35 | | template <typename T, T v> |
36 | | constexpr inline const T exp<T, v, 0> = 1; |
37 | | |
38 | | // compile-time exponentiation table { exp(v, I) ... } |
39 | | template <typename T, T v, std::size_t... I> |
40 | | constexpr inline const T exp_table[] = {exp<T, v, I>...}; |
41 | | |
42 | | // get value from compile-time exponentiation table by a (maybe) runtime offset |
43 | | template <typename T, T v, std::size_t... I> |
44 | 11.5k | constexpr T get_exp_helper(std::size_t x, std::index_sequence<I...>) { |
45 | 11.5k | return exp_table<T, v, I...>[x]; |
46 | 11.5k | } |
47 | | |
48 | | // get_exp_helper with table { exp(v, 0), exp(v, 1) ... exp(v, N - 1) } |
49 | | template <typename T, T v, std::size_t N> |
50 | 11.5k | constexpr T get_exp(std::size_t x) { |
51 | 11.5k | return get_exp_helper<T, v>(x, std::make_index_sequence<N> {}); |
52 | 11.5k | } |
53 | | |
54 | | } // namespace exp_details |
55 | | |
56 | 11.5k | inline uint64_t int_exp10(int x) { |
57 | 11.5k | if (x < 0) { |
58 | 0 | return 0; |
59 | 0 | } |
60 | 11.5k | if (x > 19) { |
61 | 0 | return std::numeric_limits<uint64_t>::max(); |
62 | 0 | } |
63 | | |
64 | 11.5k | return exp_details::get_exp<uint64_t, 10, 20>(x); |
65 | 11.5k | } |
66 | | |
67 | | namespace common { |
68 | | |
69 | 368k | constexpr inline int exp10_i32(int x) { |
70 | 368k | if (x < 0) { |
71 | 218 | return 0; |
72 | 218 | } |
73 | 368k | if (x > 9) { |
74 | 814 | return std::numeric_limits<int>::max(); |
75 | 814 | } |
76 | | |
77 | 367k | constexpr int values[] = {1, 10, 100, 1000, 10000, |
78 | 367k | 100000, 1000000, 10000000, 100000000, 1000000000}; |
79 | 367k | return values[x]; |
80 | 368k | } |
81 | | |
82 | 293k | constexpr inline int64_t exp10_i64(int x) { |
83 | 293k | if (x < 0) { |
84 | 212 | return 0; |
85 | 212 | } |
86 | 293k | if (x > 18) { |
87 | 126 | return std::numeric_limits<int64_t>::max(); |
88 | 126 | } |
89 | | |
90 | 292k | constexpr int64_t values[] = {1LL, |
91 | 292k | 10LL, |
92 | 292k | 100LL, |
93 | 292k | 1000LL, |
94 | 292k | 10000LL, |
95 | 292k | 100000LL, |
96 | 292k | 1000000LL, |
97 | 292k | 10000000LL, |
98 | 292k | 100000000LL, |
99 | 292k | 1000000000LL, |
100 | 292k | 10000000000LL, |
101 | 292k | 100000000000LL, |
102 | 292k | 1000000000000LL, |
103 | 292k | 10000000000000LL, |
104 | 292k | 100000000000000LL, |
105 | 292k | 1000000000000000LL, |
106 | 292k | 10000000000000000LL, |
107 | 292k | 100000000000000000LL, |
108 | 292k | 1000000000000000000LL}; |
109 | 292k | return values[x]; |
110 | 293k | } |
111 | | |
112 | 386k | constexpr inline __int128 exp10_i128(int x) { |
113 | 386k | if (x < 0) { |
114 | 288 | return 0; |
115 | 288 | } |
116 | 385k | if (x > 38) { |
117 | 76 | return std::numeric_limits<__int128>::max(); |
118 | 76 | } |
119 | | |
120 | 385k | constexpr __int128 values[] = { |
121 | 385k | static_cast<__int128>(1LL), |
122 | 385k | static_cast<__int128>(10LL), |
123 | 385k | static_cast<__int128>(100LL), |
124 | 385k | static_cast<__int128>(1000LL), |
125 | 385k | static_cast<__int128>(10000LL), |
126 | 385k | static_cast<__int128>(100000LL), |
127 | 385k | static_cast<__int128>(1000000LL), |
128 | 385k | static_cast<__int128>(10000000LL), |
129 | 385k | static_cast<__int128>(100000000LL), |
130 | 385k | static_cast<__int128>(1000000000LL), |
131 | 385k | static_cast<__int128>(10000000000LL), |
132 | 385k | static_cast<__int128>(100000000000LL), |
133 | 385k | static_cast<__int128>(1000000000000LL), |
134 | 385k | static_cast<__int128>(10000000000000LL), |
135 | 385k | static_cast<__int128>(100000000000000LL), |
136 | 385k | static_cast<__int128>(1000000000000000LL), |
137 | 385k | static_cast<__int128>(10000000000000000LL), |
138 | 385k | static_cast<__int128>(100000000000000000LL), |
139 | 385k | static_cast<__int128>(1000000000000000000LL), |
140 | 385k | static_cast<__int128>(1000000000000000000LL) * 10LL, |
141 | 385k | static_cast<__int128>(1000000000000000000LL) * 100LL, |
142 | 385k | static_cast<__int128>(1000000000000000000LL) * 1000LL, |
143 | 385k | static_cast<__int128>(1000000000000000000LL) * 10000LL, |
144 | 385k | static_cast<__int128>(1000000000000000000LL) * 100000LL, |
145 | 385k | static_cast<__int128>(1000000000000000000LL) * 1000000LL, |
146 | 385k | static_cast<__int128>(1000000000000000000LL) * 10000000LL, |
147 | 385k | static_cast<__int128>(1000000000000000000LL) * 100000000LL, |
148 | 385k | static_cast<__int128>(1000000000000000000LL) * 1000000000LL, |
149 | 385k | static_cast<__int128>(1000000000000000000LL) * 10000000000LL, |
150 | 385k | static_cast<__int128>(1000000000000000000LL) * 100000000000LL, |
151 | 385k | static_cast<__int128>(1000000000000000000LL) * 1000000000000LL, |
152 | 385k | static_cast<__int128>(1000000000000000000LL) * 10000000000000LL, |
153 | 385k | static_cast<__int128>(1000000000000000000LL) * 100000000000000LL, |
154 | 385k | static_cast<__int128>(1000000000000000000LL) * 1000000000000000LL, |
155 | 385k | static_cast<__int128>(1000000000000000000LL) * 10000000000000000LL, |
156 | 385k | static_cast<__int128>(1000000000000000000LL) * 100000000000000000LL, |
157 | 385k | static_cast<__int128>(1000000000000000000LL) * 100000000000000000LL * 10LL, |
158 | 385k | static_cast<__int128>(1000000000000000000LL) * 100000000000000000LL * 100LL, |
159 | 385k | static_cast<__int128>(1000000000000000000LL) * 100000000000000000LL * 1000LL}; |
160 | 385k | return values[x]; |
161 | 385k | } |
162 | | |
163 | 466k | constexpr inline wide::Int256 exp10_i256(int x) { |
164 | 466k | if (x < 0) { |
165 | 212 | return 0; |
166 | 212 | } |
167 | 465k | if (x > 76) { |
168 | 110 | return std::numeric_limits<wide::Int256>::max(); |
169 | 110 | } |
170 | | |
171 | 465k | constexpr wide::Int256 i10e18 {1000000000000000000LL}; |
172 | 465k | constexpr wide::Int256 values[] = { |
173 | 465k | static_cast<wide::Int256>(1LL), |
174 | 465k | static_cast<wide::Int256>(10LL), |
175 | 465k | static_cast<wide::Int256>(100LL), |
176 | 465k | static_cast<wide::Int256>(1000LL), |
177 | 465k | static_cast<wide::Int256>(10000LL), |
178 | 465k | static_cast<wide::Int256>(100000LL), |
179 | 465k | static_cast<wide::Int256>(1000000LL), |
180 | 465k | static_cast<wide::Int256>(10000000LL), |
181 | 465k | static_cast<wide::Int256>(100000000LL), |
182 | 465k | static_cast<wide::Int256>(1000000000LL), |
183 | 465k | static_cast<wide::Int256>(10000000000LL), |
184 | 465k | static_cast<wide::Int256>(100000000000LL), |
185 | 465k | static_cast<wide::Int256>(1000000000000LL), |
186 | 465k | static_cast<wide::Int256>(10000000000000LL), |
187 | 465k | static_cast<wide::Int256>(100000000000000LL), |
188 | 465k | static_cast<wide::Int256>(1000000000000000LL), |
189 | 465k | static_cast<wide::Int256>(10000000000000000LL), |
190 | 465k | static_cast<wide::Int256>(100000000000000000LL), |
191 | 465k | i10e18, |
192 | 465k | i10e18 * 10LL, |
193 | 465k | i10e18 * 100LL, |
194 | 465k | i10e18 * 1000LL, |
195 | 465k | i10e18 * 10000LL, |
196 | 465k | i10e18 * 100000LL, |
197 | 465k | i10e18 * 1000000LL, |
198 | 465k | i10e18 * 10000000LL, |
199 | 465k | i10e18 * 100000000LL, |
200 | 465k | i10e18 * 1000000000LL, |
201 | 465k | i10e18 * 10000000000LL, |
202 | 465k | i10e18 * 100000000000LL, |
203 | 465k | i10e18 * 1000000000000LL, |
204 | 465k | i10e18 * 10000000000000LL, |
205 | 465k | i10e18 * 100000000000000LL, |
206 | 465k | i10e18 * 1000000000000000LL, |
207 | 465k | i10e18 * 10000000000000000LL, |
208 | 465k | i10e18 * 100000000000000000LL, |
209 | 465k | i10e18 * 100000000000000000LL * 10LL, |
210 | 465k | i10e18 * 100000000000000000LL * 100LL, |
211 | 465k | i10e18 * 100000000000000000LL * 1000LL, |
212 | 465k | i10e18 * 100000000000000000LL * 10000LL, |
213 | 465k | i10e18 * 100000000000000000LL * 100000LL, |
214 | 465k | i10e18 * 100000000000000000LL * 1000000LL, |
215 | 465k | i10e18 * 100000000000000000LL * 10000000LL, |
216 | 465k | i10e18 * 100000000000000000LL * 100000000LL, |
217 | 465k | i10e18 * 100000000000000000LL * 1000000000LL, |
218 | 465k | i10e18 * 100000000000000000LL * 10000000000LL, |
219 | 465k | i10e18 * 100000000000000000LL * 100000000000LL, |
220 | 465k | i10e18 * 100000000000000000LL * 1000000000000LL, |
221 | 465k | i10e18 * 100000000000000000LL * 10000000000000LL, |
222 | 465k | i10e18 * 100000000000000000LL * 100000000000000LL, |
223 | 465k | i10e18 * 100000000000000000LL * 1000000000000000LL, |
224 | 465k | i10e18 * 100000000000000000LL * 10000000000000000LL, |
225 | 465k | i10e18 * 100000000000000000LL * 100000000000000000LL, |
226 | 465k | i10e18 * 100000000000000000LL * 100000000000000000LL * 10LL, |
227 | 465k | i10e18 * 100000000000000000LL * 100000000000000000LL * 100LL, |
228 | 465k | i10e18 * 100000000000000000LL * 100000000000000000LL * 1000LL, |
229 | 465k | i10e18 * 100000000000000000LL * 100000000000000000LL * 10000LL, |
230 | 465k | i10e18 * 100000000000000000LL * 100000000000000000LL * 100000LL, |
231 | 465k | i10e18 * 100000000000000000LL * 100000000000000000LL * 1000000LL, |
232 | 465k | i10e18 * 100000000000000000LL * 100000000000000000LL * 10000000LL, |
233 | 465k | i10e18 * 100000000000000000LL * 100000000000000000LL * 100000000LL, |
234 | 465k | i10e18 * 100000000000000000LL * 100000000000000000LL * 1000000000LL, |
235 | 465k | i10e18 * 100000000000000000LL * 100000000000000000LL * 10000000000LL, |
236 | 465k | i10e18 * 100000000000000000LL * 100000000000000000LL * 100000000000LL, |
237 | 465k | i10e18 * 100000000000000000LL * 100000000000000000LL * 1000000000000LL, |
238 | 465k | i10e18 * 100000000000000000LL * 100000000000000000LL * 10000000000000LL, |
239 | 465k | i10e18 * 100000000000000000LL * 100000000000000000LL * 100000000000000LL, |
240 | 465k | i10e18 * 100000000000000000LL * 100000000000000000LL * 1000000000000000LL, |
241 | 465k | i10e18 * 100000000000000000LL * 100000000000000000LL * 10000000000000000LL, |
242 | 465k | i10e18 * 100000000000000000LL * 100000000000000000LL * 100000000000000000LL, |
243 | 465k | i10e18 * 100000000000000000LL * 100000000000000000LL * 100000000000000000LL * 10LL, |
244 | 465k | i10e18 * 100000000000000000LL * 100000000000000000LL * 100000000000000000LL * 100LL, |
245 | 465k | i10e18 * 100000000000000000LL * 100000000000000000LL * 100000000000000000LL * 1000LL, |
246 | 465k | i10e18 * 100000000000000000LL * 100000000000000000LL * 100000000000000000LL * 10000LL, |
247 | 465k | i10e18 * 100000000000000000LL * 100000000000000000LL * 100000000000000000LL * 100000LL, |
248 | 465k | i10e18 * 100000000000000000LL * 100000000000000000LL * 100000000000000000LL * 1000000LL, |
249 | 465k | i10e18 * 100000000000000000LL * 100000000000000000LL * 100000000000000000LL * |
250 | 465k | 10000000LL, |
251 | 465k | }; |
252 | 465k | return values[x]; |
253 | 465k | } |
254 | | |
255 | 1.61k | constexpr inline int max_i32(int digit_count) { |
256 | 1.61k | if (digit_count < 0) { |
257 | 0 | return 0; |
258 | 0 | } |
259 | 1.61k | if (digit_count > 9) { |
260 | 0 | return std::numeric_limits<int>::max(); |
261 | 0 | } |
262 | 1.61k | constexpr int values[] = {0, 9, 99, 999, 9999, 99999, 999999, 9999999, 99999999, 999999999}; |
263 | 1.61k | return values[digit_count]; |
264 | 1.61k | } |
265 | | |
266 | 1.80k | constexpr inline int64_t max_i64(int digit_count) { |
267 | 1.80k | if (digit_count < 0) { |
268 | 0 | return 0; |
269 | 0 | } |
270 | 1.80k | if (digit_count > 18) { |
271 | 0 | return std::numeric_limits<int64_t>::max(); |
272 | 0 | } |
273 | | |
274 | 1.80k | constexpr int64_t values[] = {1LL, |
275 | 1.80k | 9LL, |
276 | 1.80k | 99LL, |
277 | 1.80k | 999LL, |
278 | 1.80k | 9999LL, |
279 | 1.80k | 99999LL, |
280 | 1.80k | 999999LL, |
281 | 1.80k | 9999999LL, |
282 | 1.80k | 99999999LL, |
283 | 1.80k | 999999999LL, |
284 | 1.80k | 9999999999LL, |
285 | 1.80k | 99999999999LL, |
286 | 1.80k | 999999999999LL, |
287 | 1.80k | 9999999999999LL, |
288 | 1.80k | 99999999999999LL, |
289 | 1.80k | 999999999999999LL, |
290 | 1.80k | 9999999999999999LL, |
291 | 1.80k | 99999999999999999LL, |
292 | 1.80k | 999999999999999999LL}; |
293 | 1.80k | return values[digit_count]; |
294 | 1.80k | } |
295 | | |
296 | 94 | constexpr inline int count_digits_fast(int64_t n) { |
297 | 94 | uint64_t abs_n = (n < 0 ? uint64_t(-n) : uint64_t(n)); |
298 | 94 | if (abs_n == 0) [[unlikely]] { |
299 | 5 | return 1; |
300 | 5 | } |
301 | | |
302 | 89 | int bits = 64 - __builtin_clzll(abs_n); |
303 | 89 | int d = (bits * 1233) >> 12; |
304 | | |
305 | 89 | if (abs_n < int_exp10(d)) { |
306 | 13 | --d; |
307 | 76 | } else if (abs_n >= int_exp10(d + 1)) { |
308 | 0 | ++d; |
309 | 0 | } |
310 | | |
311 | 89 | return d + 1; |
312 | 94 | } |
313 | | |
314 | 1.61k | constexpr inline __int128 max_i128(int digit_count) { |
315 | 1.61k | DCHECK(digit_count > 0); |
316 | 1.61k | constexpr __int128 values[] = { |
317 | 1.61k | static_cast<__int128>(0LL), |
318 | 1.61k | static_cast<__int128>(9LL), |
319 | 1.61k | static_cast<__int128>(99LL), |
320 | 1.61k | static_cast<__int128>(999LL), |
321 | 1.61k | static_cast<__int128>(9999LL), |
322 | 1.61k | static_cast<__int128>(99999LL), |
323 | 1.61k | static_cast<__int128>(999999LL), |
324 | 1.61k | static_cast<__int128>(9999999LL), |
325 | 1.61k | static_cast<__int128>(99999999LL), |
326 | 1.61k | static_cast<__int128>(999999999LL), |
327 | 1.61k | static_cast<__int128>(9999999999LL), |
328 | 1.61k | static_cast<__int128>(99999999999LL), |
329 | 1.61k | static_cast<__int128>(999999999999LL), |
330 | 1.61k | static_cast<__int128>(9999999999999LL), |
331 | 1.61k | static_cast<__int128>(99999999999999LL), |
332 | 1.61k | static_cast<__int128>(999999999999999LL), |
333 | 1.61k | static_cast<__int128>(9999999999999999LL), |
334 | 1.61k | static_cast<__int128>(99999999999999999LL), |
335 | 1.61k | static_cast<__int128>(999999999999999999LL), |
336 | 1.61k | static_cast<__int128>(1000000000000000000LL) * 10LL - 1, |
337 | 1.61k | static_cast<__int128>(1000000000000000000LL) * 100LL - 1, |
338 | 1.61k | static_cast<__int128>(1000000000000000000LL) * 1000LL - 1, |
339 | 1.61k | static_cast<__int128>(1000000000000000000LL) * 10000LL - 1, |
340 | 1.61k | static_cast<__int128>(1000000000000000000LL) * 100000LL - 1, |
341 | 1.61k | static_cast<__int128>(1000000000000000000LL) * 1000000LL - 1, |
342 | 1.61k | static_cast<__int128>(1000000000000000000LL) * 10000000LL - 1, |
343 | 1.61k | static_cast<__int128>(1000000000000000000LL) * 100000000LL - 1, |
344 | 1.61k | static_cast<__int128>(1000000000000000000LL) * 1000000000LL - 1, |
345 | 1.61k | static_cast<__int128>(1000000000000000000LL) * 10000000000LL - 1, |
346 | 1.61k | static_cast<__int128>(1000000000000000000LL) * 100000000000LL - 1, |
347 | 1.61k | static_cast<__int128>(1000000000000000000LL) * 1000000000000LL - 1, |
348 | 1.61k | static_cast<__int128>(1000000000000000000LL) * 10000000000000LL - 1, |
349 | 1.61k | static_cast<__int128>(1000000000000000000LL) * 100000000000000LL - 1, |
350 | 1.61k | static_cast<__int128>(1000000000000000000LL) * 1000000000000000LL - 1, |
351 | 1.61k | static_cast<__int128>(1000000000000000000LL) * 10000000000000000LL - 1, |
352 | 1.61k | static_cast<__int128>(1000000000000000000LL) * 100000000000000000LL - 1, |
353 | 1.61k | static_cast<__int128>(1000000000000000000LL) * 100000000000000000LL * 10LL - 1, |
354 | 1.61k | static_cast<__int128>(1000000000000000000LL) * 100000000000000000LL * 100LL - 1, |
355 | 1.61k | static_cast<__int128>(1000000000000000000LL) * 100000000000000000LL * 1000LL - 1}; |
356 | 1.61k | return values[digit_count]; |
357 | 1.61k | } |
358 | | |
359 | 1.46k | constexpr inline wide::Int256 max_i256(int digit_count) { |
360 | 1.46k | if (digit_count < 0) { |
361 | 0 | return 0; |
362 | 0 | } |
363 | 1.46k | if (digit_count > 76) { |
364 | 0 | return std::numeric_limits<wide::Int256>::max(); |
365 | 0 | } |
366 | | |
367 | 1.46k | constexpr wide::Int256 i10e18 {1000000000000000000LL}; |
368 | 1.46k | constexpr wide::Int256 values[] = { |
369 | 1.46k | static_cast<wide::Int256>(0LL), |
370 | 1.46k | static_cast<wide::Int256>(9LL), |
371 | 1.46k | static_cast<wide::Int256>(99LL), |
372 | 1.46k | static_cast<wide::Int256>(999LL), |
373 | 1.46k | static_cast<wide::Int256>(9999LL), |
374 | 1.46k | static_cast<wide::Int256>(99999LL), |
375 | 1.46k | static_cast<wide::Int256>(999999LL), |
376 | 1.46k | static_cast<wide::Int256>(9999999LL), |
377 | 1.46k | static_cast<wide::Int256>(99999999LL), |
378 | 1.46k | static_cast<wide::Int256>(999999999LL), |
379 | 1.46k | static_cast<wide::Int256>(9999999999LL), |
380 | 1.46k | static_cast<wide::Int256>(99999999999LL), |
381 | 1.46k | static_cast<wide::Int256>(999999999999LL), |
382 | 1.46k | static_cast<wide::Int256>(9999999999999LL), |
383 | 1.46k | static_cast<wide::Int256>(99999999999999LL), |
384 | 1.46k | static_cast<wide::Int256>(999999999999999LL), |
385 | 1.46k | static_cast<wide::Int256>(9999999999999999LL), |
386 | 1.46k | static_cast<wide::Int256>(99999999999999999LL), |
387 | 1.46k | i10e18 - 1, |
388 | 1.46k | i10e18 * 10LL - 1, |
389 | 1.46k | i10e18 * 100LL - 1, |
390 | 1.46k | i10e18 * 1000LL - 1, |
391 | 1.46k | i10e18 * 10000LL - 1, |
392 | 1.46k | i10e18 * 100000LL - 1, |
393 | 1.46k | i10e18 * 1000000LL - 1, |
394 | 1.46k | i10e18 * 10000000LL - 1, |
395 | 1.46k | i10e18 * 100000000LL - 1, |
396 | 1.46k | i10e18 * 1000000000LL - 1, |
397 | 1.46k | i10e18 * 10000000000LL - 1, |
398 | 1.46k | i10e18 * 100000000000LL - 1, |
399 | 1.46k | i10e18 * 1000000000000LL - 1, |
400 | 1.46k | i10e18 * 10000000000000LL - 1, |
401 | 1.46k | i10e18 * 100000000000000LL - 1, |
402 | 1.46k | i10e18 * 1000000000000000LL - 1, |
403 | 1.46k | i10e18 * 10000000000000000LL - 1, |
404 | 1.46k | i10e18 * 100000000000000000LL - 1, |
405 | 1.46k | i10e18 * 100000000000000000LL * 10LL - 1, |
406 | 1.46k | i10e18 * 100000000000000000LL * 100LL - 1, |
407 | 1.46k | i10e18 * 100000000000000000LL * 1000LL - 1, |
408 | 1.46k | i10e18 * 100000000000000000LL * 10000LL - 1, |
409 | 1.46k | i10e18 * 100000000000000000LL * 100000LL - 1, |
410 | 1.46k | i10e18 * 100000000000000000LL * 1000000LL - 1, |
411 | 1.46k | i10e18 * 100000000000000000LL * 10000000LL - 1, |
412 | 1.46k | i10e18 * 100000000000000000LL * 100000000LL - 1, |
413 | 1.46k | i10e18 * 100000000000000000LL * 1000000000LL - 1, |
414 | 1.46k | i10e18 * 100000000000000000LL * 10000000000LL - 1, |
415 | 1.46k | i10e18 * 100000000000000000LL * 100000000000LL - 1, |
416 | 1.46k | i10e18 * 100000000000000000LL * 1000000000000LL - 1, |
417 | 1.46k | i10e18 * 100000000000000000LL * 10000000000000LL - 1, |
418 | 1.46k | i10e18 * 100000000000000000LL * 100000000000000LL - 1, |
419 | 1.46k | i10e18 * 100000000000000000LL * 1000000000000000LL - 1, |
420 | 1.46k | i10e18 * 100000000000000000LL * 10000000000000000LL - 1, |
421 | 1.46k | i10e18 * 100000000000000000LL * 100000000000000000LL - 1, |
422 | 1.46k | i10e18 * 100000000000000000LL * 100000000000000000LL * 10LL - 1, |
423 | 1.46k | i10e18 * 100000000000000000LL * 100000000000000000LL * 100LL - 1, |
424 | 1.46k | i10e18 * 100000000000000000LL * 100000000000000000LL * 1000LL - 1, |
425 | 1.46k | i10e18 * 100000000000000000LL * 100000000000000000LL * 10000LL - 1, |
426 | 1.46k | i10e18 * 100000000000000000LL * 100000000000000000LL * 100000LL - 1, |
427 | 1.46k | i10e18 * 100000000000000000LL * 100000000000000000LL * 1000000LL - 1, |
428 | 1.46k | i10e18 * 100000000000000000LL * 100000000000000000LL * 10000000LL - 1, |
429 | 1.46k | i10e18 * 100000000000000000LL * 100000000000000000LL * 100000000LL - 1, |
430 | 1.46k | i10e18 * 100000000000000000LL * 100000000000000000LL * 1000000000LL - 1, |
431 | 1.46k | i10e18 * 100000000000000000LL * 100000000000000000LL * 10000000000LL - 1, |
432 | 1.46k | i10e18 * 100000000000000000LL * 100000000000000000LL * 100000000000LL - 1, |
433 | 1.46k | i10e18 * 100000000000000000LL * 100000000000000000LL * 1000000000000LL - 1, |
434 | 1.46k | i10e18 * 100000000000000000LL * 100000000000000000LL * 10000000000000LL - 1, |
435 | 1.46k | i10e18 * 100000000000000000LL * 100000000000000000LL * 100000000000000LL - 1, |
436 | 1.46k | i10e18 * 100000000000000000LL * 100000000000000000LL * 1000000000000000LL - 1, |
437 | 1.46k | i10e18 * 100000000000000000LL * 100000000000000000LL * 10000000000000000LL - 1, |
438 | 1.46k | i10e18 * 100000000000000000LL * 100000000000000000LL * 100000000000000000LL - 1, |
439 | 1.46k | i10e18 * 100000000000000000LL * 100000000000000000LL * 100000000000000000LL * 10LL - 1, |
440 | 1.46k | i10e18 * 100000000000000000LL * 100000000000000000LL * 100000000000000000LL * 100LL - 1, |
441 | 1.46k | i10e18 * 100000000000000000LL * 100000000000000000LL * 100000000000000000LL * 1000LL - |
442 | 1.46k | 1, |
443 | 1.46k | i10e18 * 100000000000000000LL * 100000000000000000LL * 100000000000000000LL * 10000LL - |
444 | 1.46k | 1, |
445 | 1.46k | i10e18 * 100000000000000000LL * 100000000000000000LL * 100000000000000000LL * 100000LL - |
446 | 1.46k | 1, |
447 | 1.46k | i10e18 * 100000000000000000LL * 100000000000000000LL * 100000000000000000LL * |
448 | 1.46k | 1000000LL - |
449 | 1.46k | 1, |
450 | 1.46k | i10e18 * 100000000000000000LL * 100000000000000000LL * 100000000000000000LL * |
451 | 1.46k | 10000000LL - |
452 | 1.46k | 1, |
453 | 1.46k | }; |
454 | 1.46k | return values[digit_count]; |
455 | 1.46k | } |
456 | | } // namespace common |