1 //
2 // Copyright 2018 The Abseil Authors.
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 //      https://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 // This test helper library contains a table of powers of 10, to guarantee
17 // precise values are computed across the full range of doubles. We can't rely
18 // on the pow() function, because not all standard libraries ship a version
19 // that is precise.
20 #ifndef ABSL_STRINGS_INTERNAL_POW10_HELPER_H_
21 #define ABSL_STRINGS_INTERNAL_POW10_HELPER_H_
22 
23 #include <vector>
24 
25 #include "absl/base/config.h"
26 
27 namespace absl {
28 ABSL_NAMESPACE_BEGIN
29 namespace strings_internal {
30 
31 // Computes the precise value of 10^exp. (I.e. the nearest representable
32 // double to the exact value, rounding to nearest-even in the (single) case of
33 // being exactly halfway between.)
34 double Pow10(int exp);
35 
36 }  // namespace strings_internal
37 ABSL_NAMESPACE_END
38 }  // namespace absl
39 
40 #endif  // ABSL_STRINGS_INTERNAL_POW10_HELPER_H_
41