E.V.E  0.1-beta

◆ is_flint

eve::is_flint = {}
inlineconstexpr

Callable object computing the is_flint logical value.

Required header: #include <eve/function/is_flint.hpp>

Members Functions

Member Effect
operator() the computation of the is_flint logical value
operator[] Construct a conditional version of current function object

auto operator()(floating_real_value auto x ) const noexcept;
Definition: value.hpp:103

Parameters

x: floating real value.

Return value

The call:

constexpr callable_is_flint_ is_flint
Callable object computing the is_flint logical value.
Definition: is_flint.hpp:87
Wrapper for SIMD compatible logical types.
Definition: logical.hpp:36

is semantically equivalent to: eve::is_eqz(eve::frac(x));

This means that x is a floating real value representing an integer (flint is a shorcut for 'floating integer').


auto operator[]( conditional_expression auto cond ) const noexcept;

Higher-order function generating a masked version of eve::is_flint

Parameters

cond : conditional expression

Return value

A Callable object so that the expression is_flint[cond](x) is equivalent to if_else(cond,is_flint(x),false(as(is_flint(x))))


Supported decorators

  • eve::pedantic Pedantically speaking flint stands for floating integer. The call pedantic(is_flint)(x) considers that integral typed values are not floating and so pedantic(is_flint)(x) returns false for all elements of this types. Moreover a floating point value is pedantically deemed as flint only is the next representable value is not flint, so great floating values are not pedantically flint.

Example

See it live on Compiler Explorer

#include <eve/function/is_flint.hpp>
#include <eve/function/pedantic/is_flint.hpp>
#include <eve/wide.hpp>
#include <eve/constant/inf.hpp>
#include <eve/constant/maxflint.hpp>
#include <eve/constant/valmax.hpp>
#include <eve/constant/minf.hpp>
#include <eve/constant/nan.hpp>
#include <iostream>
int main()
{
wide_ft pf = {0.0f, 1.0f, -1.5f, -2.0f, eve::valmax(eve::as<float>()),
std::cout << "---- simd" << '\n'
<< "<- pf = " << pf << '\n'
<< "-> is_flint(pf) = " << eve::is_flint(pf) << '\n'
<< "-> pedantic(is_flint)(pf) = " << eve::pedantic(eve::is_flint)(pf) << '\n' ;
float xf = 1.0f;
std::cout << "---- scalar" << '\n'
<< "<- xf = " << xf << '\n'
<< "-> is_flint(xf) = " << eve::is_flint(xf) << '\n';
return 0;
}
constexpr callable_valmax_ valmax
Callable object computing the greatest representable value.
Definition: valmax.hpp:53
constexpr callable_maxflint_ maxflint
Callable object computing the greatest real n representing an integer and such that n !...
Definition: maxflint.hpp:57
constexpr callable_nan_ nan
Callable object computing the nan value.
Definition: nan.hpp:52
constexpr callable_inf_ inf
Callable object computing the infinity ieee value.
Definition: inf.hpp:54
constexpr pedantic_type const pedantic
Higher-order Callable Object imbuing more standard semantic onto other Callable Objects.
Definition: pedantic.hpp:56
Lightweight type-wrapper.
Definition: as.hpp:29
Wrapper for SIMD registers.
Definition: wide.hpp:65