GCC Code Coverage Report


Directory: include/polyfloat/
File: include/polyfloat/module/core/constants/inf.hpp
Date: 2026-11-09 15:28:50
Exec Total Coverage
Lines: 4 4 100.0%
Functions: 22 22 100.0%
Branches: 1 1 100.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 <eve/eve.hpp>
11 #include <polyfloat/details/callable.hpp>
12 #include <polyfloat/types/concepts.hpp>
13 #include <polyfloat/types/traits.hpp>
14
15 namespace plf
16 {
17 template<typename Options> struct inf_t : eve::constant_callable<inf_t, Options>
18 {
19 13974 template<typename T> POLYFLOAT_ABI static constexpr auto value(eve::as<T> const&, auto const&)
20 {
21 using u_t = eve::underlying_type_t<T>;
22
1/1
✓ Branch 2 taken 6990 times.
13974 return T(eve::inf(eve::as<u_t>()));
23 }
24
25 13976 template<concepts::polyfloat_like T> POLYFLOAT_ABI constexpr T operator()(as<T> const& v) const
26 {
27 13976 return POLYFLOAT_CALL(v);
28 }
29
30 POLYFLOAT_CALLABLE_OBJECT(inf_t, inf_);
31 };
32 //======================================================================================================================
33 //! @addtogroup constants
34 //! @{
35 //! @var inf
36 //! @brief return the infinite value.
37 //!
38 //! @groupheader{Header file}
39 //!
40 //! @code
41 //! #include <polyfloat/core.hpp>
42 //! @endcode
43 //!
44 //! @groupheader{Callable Signatures}
45 //!
46 //! @code
47 //! namespace polyfloat
48 //! {
49 //! template<polyfloat::concepts::polyfloat_like T> constexpr auto inf(T z) noexcept;
50 //! }
51 //! @endcode
52 //!
53 //! **Parameters**
54 //!
55 //! * `T`: type to return.
56 //!
57 //! **Return value**
58 //!
59 //! Returns the inf value in type T.
60 //!
61 //! @groupheader{Example}
62 //!
63 //! @godbolt_todo{doc/inf.cpp}
64 //======================================================================================================================
65
66 inline constexpr auto inf = eve::functor<inf_t>;
67 //======================================================================================================================
68 //! @}
69 //======================================================================================================================
70 }
71