GCC Code Coverage Report


Directory: include/polyfloat/
File: include/polyfloat/module/core/is_nez.hpp
Date: 2026-11-09 15:28:50
Exec Total Coverage
Lines: 5 5 100.0%
Functions: 49 49 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 <type_traits>
14
15 namespace plf
16 {
17
18 template<typename Options> struct is_nez_t : eve::elementwise_callable<is_nez_t, Options, raw_option, pedantic_option>
19 {
20 template<concepts::polyfloat_like Z>
21 113715 POLYFLOAT_ABI constexpr eve::as_logical_t<plf::as_component_type_t<Z>> operator()(Z z) const noexcept
22 {
23 113715 return POLYFLOAT_CALL(z);
24 }
25
26 113659 POLYFLOAT_CALLABLE_OBJECT(is_nez_t, is_nez_);
27 };
28 //======================================================================================================================
29 //! @addtogroup core
30 //! @{
31 //! @var is_nez
32 //! @brief test the parameter for not equal to zero.
33 //!
34 //! @groupheader{Header file}
35 //!
36 //! @code
37 //! #include <polyfloat/core.hpp>
38 //! @endcode
39 //!
40 //! @groupheader{Callable Signatures}
41 //!
42 //! @code
43 //! namespace polyfloat
44 //! {
45 //! template<polyfloat::concepts::polyfloat_like T> constexpr auto is_nez(T z) noexcept;
46 //! }
47 //! @endcode
48 //!
49 //! **Parameters**
50 //!
51 //! * `z`: Value to process.
52 //!
53 //! **Return value**
54 //!
55 //! Returns the value of z != 0.
56 //!
57 //! @groupheader{Example}
58 //!
59 //! @godbolt_todo{doc/core/is_nez.cpp}
60 //======================================================================================================================
61
62 inline constexpr auto is_nez = eve::functor<is_nez_t>;
63 //======================================================================================================================
64 //! @}
65 //======================================================================================================================
66 }
67
68 namespace plf::_
69 {
70 113659 template<typename Z, eve::callable_options O> constexpr auto is_nez_(POLYFLOAT_DELAY(), O const&, Z const& z) noexcept
71 {
72 113659 return eve::is_nez(hi(z));
73 }
74 }
75