GCC Code Coverage Report


Directory: include/polyfloat/
File: include/polyfloat/module/core/rec.hpp
Date: 2026-11-09 15:28:50
Exec Total Coverage
Lines: 5 5 100.0%
Functions: 96 98 98.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 <type_traits>
14
15 namespace plf
16 {
17
18 template<typename Options> struct rec_t : eve::elementwise_callable<rec_t, Options, raw_option, pedantic_option>
19 {
20 169328 template<concepts::polyfloat_like Z> POLYFLOAT_ABI Z operator()(Z z) const noexcept { return POLYFLOAT_CALL(z); }
21
22 131896 POLYFLOAT_CALLABLE_OBJECT(rec_t, rec_);
23 };
24 //======================================================================================================================
25 //! @addtogroup core
26 //! @{
27 //! @var rec
28 //! @brief return the ratio of the values.
29 //!
30 //! @groupheader{Header file}
31 //!
32 //! @code
33 //! #include <polyfloat/core.hpp>
34 //! @endcode
35 //!
36 //! @groupheader{Callable Signatures}
37 //!
38 //! @code
39 //! namespace polyfloat
40 //! {
41 //! template<polyfloat::concepts::polyfloat_like T1, polyfloat_like Z2> constexpr auto rec(T1 z1, T2 z2) noexcept;
42 //! }
43 //! @endcode
44 //!
45 //! **Parameters**
46 //!
47 //! * `z`: Value to process.
48 //!
49 //! **Return value**
50 //!
51 //! Returns the ratio of the arguments.
52 //!
53 //! @groupheader{Example}
54 //!
55 //! @godbolt{doc/core/rec.cpp}
56 //======================================================================================================================
57
58 inline constexpr auto rec = eve::functor<rec_t>;
59 //======================================================================================================================
60 //! @}
61 //======================================================================================================================
62 }
63
64 namespace plf::_
65 {
66 131896 template<typename Z, eve::callable_options O> constexpr auto rec_(POLYFLOAT_DELAY(), O const&, Z const& z) noexcept
67 {
68 66 if constexpr (dimension_v<Z> == 1) return eve::rec[eve::pedantic](z);
69 131830 else return _::rec(z);
70 }
71 }
72