PrevUpHomeNext

utx::nan_v, utx::is_nan


utx::nan_v

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

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

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

utx::is_nan

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

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

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

c++ example

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

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

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

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

See Also

utx::na

utx::fx32

utx::sqrt


PrevUpHomeNext

E

U