PrevUpHomeNext

esv::nan_v, esv::is_nan


Add color to the environment.

esv::nan_v

esv::nan_v - gets the NaN value of specific real type.

esv::nan_v can be applied to floating types only.

template <esv::floating_meric type1>
constexpr inline type1 nan_v = esv::nan_v_impl<type1>::value;

esv::is_nan

esv::is_nan - used to judge if a floating value is NaN or not.

esv::is_nan can be applied to floating types only.

template <esv::floating_meric float_type>
constexpr inline bool is_nan(const float_type & value);

c++ example

#include <esvcpp/core.hpp>
#include <esvcpp/math.hpp>

int main()
{
	esv::fx32 a = esv::nan_v<esv::fx32>;
	esv::fx32 b = 123.321f;
	esv::fx32 c = esv::sqrt(-1.0f);

	esv::print(esv::is_nan(a), esv::is_nan(b), esv::is_nan(c)); // true false true

	esv::print(a, b, c); // nan 123.321 nan
}

See Also

esv::na

esv::fx32

esv::sqrt


PrevUpHomeNext

esv::print