GCC Code Coverage Report


Directory: include/polyfloat/
File: include/polyfloat/module/math/constants/invlog_10.hpp
Date: 2026-11-09 15:28:50
Exec Total Coverage
Lines: 7 7 100.0%
Functions: 14 14 100.0%
Branches: 0 0 -%

Line Branch Exec Source
1 //======================================================================================================================
2 /*
3 POLYFLOAT - Extended precision floating points
4 Copyright : POLYFLOAT Contributors & Maintainers
5 SPDX-License-Identifier: BSL-1.0
6 */
7 //======================================================================================================================
8 #pragma once
9
10 #include <polyfloat/details/callable.hpp>
11 #include <polyfloat/types/concepts.hpp>
12 #include <polyfloat/types/traits.hpp>
13 #include <eve/module/math/constant/invlog_10.hpp>
14
15 namespace plf
16 {
17
18 template<typename Options>
19 struct invlog_10_t : plf::constant_callable<invlog_10_t, eve::invlog_10_t, Options, lower_option, upper_option>
20 {
21 148 template<typename T> POLYFLOAT_ABI static constexpr T value(eve::as<T> const&, auto const&)
22 {
23 using u_t = plf::as_component_type_t<T>;
24 if constexpr (plf::dimension_v<T> == 2)
25 {
26 40 if constexpr (std::same_as<u_t, float>) return plf::_::from_pair<float>(0x1.bcb7b2p-2, -0x1.5b235ep-27);
27 else if constexpr (std::same_as<u_t, double>)
28 36 return plf::_::from_pair<double>(0x1.bcb7b1526e50ep-2, 0x1.95355baaafad3p-57);
29 }
30 else if constexpr (plf::dimension_v<T> == 3)
31 {
32 if constexpr (std::same_as<u_t, float>)
33 36 return plf::_::from_triple<float>(0x1.bcb7b2p-2, -0x1.5b235ep-27, -0x1.cd5954p-54);
34 else if constexpr (std::same_as<u_t, double>)
35 36 return plf::_::from_triple<double>(0x1.bcb7b1526e50ep-2, 0x1.95355baaafad3p-57, 0x1.ee191f71a3012p-112);
36 }
37 }
38
39 160 template<concepts::polyfloat_like T> POLYFLOAT_ABI constexpr T operator()(as<T> const& v) const
40 {
41 160 return POLYFLOAT_CALL(v);
42 }
43
44 POLYFLOAT_CALLABLE_OBJECT(invlog_10_t, invlog_10_);
45 };
46 //======================================================================================================================
47 //! @addtogroup constants
48 //! @{
49 //! @var invlog_10
50 //! @brief return the log(2) value.
51 //!
52 //! @groupheader{Header file}
53 //!
54 //! @code
55 //! #include <kyosu/core.hpp>
56 //! @endcode
57 //!
58 //! @groupheader{Callable Signatures}
59 //!
60 //! @code
61 //! namespace kyosu
62 //! {
63 //! template<kyosu::concepts::polyfloat_like T> constexpr auto invlog_10(T z) noexcept;
64 //! }
65 //! @endcode
66 //!
67 //!
68 //! **Return value**
69 //!
70 //! Returns log(2).
71 //!
72 //! @groupheader{Example}
73 //!
74 //! @godbolt_todo{doc/invlog_10.cpp}
75 //======================================================================================================================
76
77 inline constexpr auto invlog_10 = eve::functor<invlog_10_t>;
78 //======================================================================================================================
79 //! @}
80 //======================================================================================================================
81 }
82