E.V.E
v2022.09.01

◆ is_denormal

eve::is_denormal = {}
inlineconstexpr

Returns a logical true if and only if the element value is denormal.

Defined in Header

#include <eve/module/core.hpp>

Callable Signatures

namespace eve
{
template< eve::value T >
eve::as_logical<T> is_denormal(T x) noexcept;
}
constexpr callable_is_denormal_ is_denormal
Returns a logical true if and only if the element value is denormal.
Definition: is_denormal.hpp:68
Definition: all_of.hpp:22

Parameters

Return value

The call is_denormal(x) is semantically equivalent to:

if constexpr(floating_value<T>)
return (eve::abs(x) < eve::smallestposval(as(x))) && is_nez(x);
else constexpr(integral_value<T>)
return eve::false_(as(x));
Definition: value.hpp:83
Definition: value.hpp:42
constexpr callable_abs_ abs
Computes the absolute value of the parameter.
Definition: abs.hpp:107
constexpr callable_smallestposval_ smallestposval
Computes the smallest normal positive value.
Definition: smallestposval.hpp:59
constexpr callable_false__ false_
Computes the false logical value.
Definition: false.hpp:52
constexpr callable_is_nez_ is_nez
Returns a logical true if and only if the element value is not zero.
Definition: is_nez.hpp:66
Lightweight type-wrapper.
Definition: as.hpp:29

Example

#include <eve/module/core.hpp>
#include <eve/wide.hpp>
#include <iostream>
int main()
{
wide_ft pf = {0.0f,1.0f, -1.0f, -2.0f,
std::cout << "---- simd" << '\n'
<< "<- pf = " << pf << '\n'
<< "-> is_denormal(pf) = " << eve::is_denormal(pf) << '\n';
float xf = 1.0f;
std::cout << "---- scalar" << '\n'
<< "<- xf = " << xf << '\n'
<< "-> is_denormal(xf) = " << eve::is_denormal(xf) << '\n'
<< "<- yf = " << yf << '\n'
<< "-> is_denormal(yf) = " << eve::is_denormal(yf) << '\n';
return 0;
}
constexpr callable_nan_ nan
Computes the IEEE NaN constant.
Definition: nan.hpp:53
constexpr callable_minf_ minf
Computes the -infinity ieee value.
Definition: minf.hpp:60
constexpr callable_mindenormal_ mindenormal
Computes the smallest denormal positive value.
Definition: mindenormal.hpp:59
constexpr callable_inf_ inf
Computes the infinity ieee value.
Definition: inf.hpp:58
Wrapper for SIMD registers.
Definition: wide.hpp:65

Semantic Modifiers