00001 // 00002 // Copyright 2018 The Abseil Authors. 00003 // 00004 // Licensed under the Apache License, Version 2.0 (the "License"); 00005 // you may not use this file except in compliance with the License. 00006 // You may obtain a copy of the License at 00007 // 00008 // https://www.apache.org/licenses/LICENSE-2.0 00009 // 00010 // Unless required by applicable law or agreed to in writing, software 00011 // distributed under the License is distributed on an "AS IS" BASIS, 00012 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00013 // See the License for the specific language governing permissions and 00014 // limitations under the License. 00015 // 00016 // This test helper library contains a table of powers of 10, to guarantee 00017 // precise values are computed across the full range of doubles. We can't rely 00018 // on the pow() function, because not all standard libraries ship a version 00019 // that is precise. 00020 #ifndef ABSL_STRINGS_INTERNAL_POW10_HELPER_H_ 00021 #define ABSL_STRINGS_INTERNAL_POW10_HELPER_H_ 00022 00023 #include <vector> 00024 00025 namespace absl { 00026 namespace strings_internal { 00027 00028 // Computes the precise value of 10^exp. (I.e. the nearest representable 00029 // double to the exact value, rounding to nearest-even in the (single) case of 00030 // being exactly halfway between.) 00031 double Pow10(int exp); 00032 00033 } // namespace strings_internal 00034 } // namespace absl 00035 00036 #endif // ABSL_STRINGS_INTERNAL_POW10_HELPER_H_