GCC Code Coverage Report


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