| 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 minf_t : eve::constant_callable<minf_t, Options> | ||
| 18 | { | ||
| 19 | 2632 | 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 1323 times.
|
2632 | return T(eve::minf(eve::as<u_t>())); |
| 23 | } | ||
| 24 | |||
| 25 | 2632 | template<concepts::polyfloat_like T> POLYFLOAT_ABI constexpr T operator()(as<T> const& v) const | |
| 26 | { | ||
| 27 | 2632 | return POLYFLOAT_CALL(v); | |
| 28 | } | ||
| 29 | |||
| 30 | POLYFLOAT_CALLABLE_OBJECT(minf_t, minf_); | ||
| 31 | }; | ||
| 32 | //====================================================================================================================== | ||
| 33 | //! @addtogroup constants | ||
| 34 | //! @{ | ||
| 35 | //! @var minf | ||
| 36 | //! @brief return the minus infinity 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 minf(as<T>) noexcept; | ||
| 50 | //! } | ||
| 51 | //! @endcode | ||
| 52 | //! | ||
| 53 | //! **Parameters** | ||
| 54 | //! | ||
| 55 | //! * `T`: type to return. | ||
| 56 | //! | ||
| 57 | //! **Return value** | ||
| 58 | //! | ||
| 59 | //! Returns the minf value in type T. | ||
| 60 | //! | ||
| 61 | //! @groupheader{Example} | ||
| 62 | //! | ||
| 63 | //! @godbolt_todo{doc/minf.cpp} | ||
| 64 | //====================================================================================================================== | ||
| 65 | |||
| 66 | inline constexpr auto minf = eve::functor<minf_t>; | ||
| 67 | //====================================================================================================================== | ||
| 68 | //! @} | ||
| 69 | //====================================================================================================================== | ||
| 70 | } | ||
| 71 |