12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- #ifndef BOOST_MP_MAX_DIGITS10_HPP
- #define BOOST_MP_MAX_DIGITS10_HPP
- namespace boost {
- namespace multiprecision {
- namespace detail {
- template <unsigned digits>
- struct calc_max_digits10
- {
- static constexpr unsigned max_digits_10(unsigned d)
- {
-
-
-
-
-
-
-
- return static_cast<unsigned>(0.301029995663981195213738894724493026768189881462108541310 * d) + 2;
- }
- static constexpr unsigned value = max_digits_10(digits);
- };
- template <std::size_t digits>
- struct calc_max_digits10_s
- {
- static constexpr std::size_t max_digits_10(std::size_t d)
- {
-
-
-
-
-
-
-
- return static_cast<std::size_t>(static_cast<std::size_t>(0.301029995663981195213738894724493026768189881462108541310 * static_cast<double>(d)) + 2u);
- }
- static constexpr std::size_t value = max_digits_10(digits);
- };
- template <unsigned digits>
- struct calc_digits10
- {
- static constexpr unsigned digits_10(unsigned d)
- {
-
-
-
-
-
- return static_cast<unsigned>(0.301029995663981195213738894724493026768189881462108541310 * static_cast<double>(d - 1u));
- }
- static constexpr unsigned value = digits_10(digits);
- };
- template <std::size_t digits>
- struct calc_digits10_s
- {
- static constexpr std::size_t digits_10(std::size_t d)
- {
-
-
-
-
-
- return static_cast<std::size_t>(0.301029995663981195213738894724493026768189881462108541310 * static_cast<double>(d - 1u));
- }
- static constexpr std::size_t value = digits_10(digits);
- };
- }}}
- #endif
|