3#ifndef INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_MATH_FLOAT_PROPERTIES_HPP_
4#define INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_MATH_FLOAT_PROPERTIES_HPP_
9#include "arene/base/compiler_support/diagnostics.hpp"
10#include "arene/base/stdlib_choice/numeric_limits.hpp"
22ARENE_IGNORE_ALL(
"-Wfloat-equal",
"Equality is used to check the properties of a single value, not compare two values");
24namespace float_properties_detail {
31constexpr auto isnan(T
const num)
noexcept ->
bool {
41constexpr auto isinf(T
const num)
noexcept ->
bool {
42 return (num == std::numeric_limits<T>::infinity()) || (num == -std::numeric_limits<T>::infinity());
50constexpr auto isfinite(T
const num)
noexcept ->
bool {
51 return (!::
arene::
base::float_properties_detail::isnan(num)) && (!::
arene::
base::float_properties_detail::isinf(num));
59constexpr auto isnormal(T num)
noexcept ->
bool {
62 if (::
arene::
base::float_properties_detail::isnan(num)) {
66 if (num <
static_cast<T>(0.0)) {
73 return (num >= std::numeric_limits<T>::min()) && (num < std::numeric_limits<T>::infinity());
86constexpr auto isnan(
float const num)
noexcept ->
bool {
return float_properties_detail::isnan(num); }
91constexpr auto isnan(
double const num)
noexcept ->
bool {
return float_properties_detail::isnan(num); }
96constexpr auto isinf(
float const num)
noexcept ->
bool {
return float_properties_detail::isinf(num); }
101constexpr auto isinf(
double const num)
noexcept ->
bool {
return float_properties_detail::isinf(num); }
106constexpr auto isfinite(
float const num)
noexcept ->
bool {
return float_properties_detail::isfinite(num); }
111constexpr auto isfinite(
double const num)
noexcept ->
bool {
return float_properties_detail::isfinite(num); }
116constexpr auto isnormal(
float const num)
noexcept ->
bool {
return float_properties_detail::isnormal(num); }
121constexpr auto isnormal(
double const num)
noexcept ->
bool {
return float_properties_detail::isnormal(num); }
Definition array_exceptions_disabled.cpp:11
constexpr auto isfinite(float const num) noexcept -> bool
Check whether or not the argument is finite, i.e. not infinity or NaN.
Definition float_properties.hpp:106
ARENE_IGNORE_ALL("-Wfloat-equal", "Equality is used to check the properties of a single value, not compare two values")
constexpr auto isnormal(float const num) noexcept -> bool
Check whether or not the argument is normal, i.e. not infinity, NaN, subnormal, or zero.
Definition float_properties.hpp:116
constexpr auto isinf(float const num) noexcept -> bool
Check whether or not the argument has a (positive or negative) infinite value.
Definition float_properties.hpp:96
constexpr auto isnan(double const num) noexcept -> bool
Check whether or not the argument has a NaN value.
Definition float_properties.hpp:91
constexpr auto isinf(double const num) noexcept -> bool
Check whether or not the argument has a (positive or negative) infinite value.
Definition float_properties.hpp:101
constexpr auto isnormal(double const num) noexcept -> bool
Check whether or not the argument is normal, i.e. not infinity, NaN, subnormal, or zero.
Definition float_properties.hpp:121
constexpr auto isnan(float const num) noexcept -> bool
Check whether or not the argument has a NaN value.
Definition float_properties.hpp:86
constexpr auto isfinite(double const num) noexcept -> bool
Check whether or not the argument is finite, i.e. not infinity or NaN.
Definition float_properties.hpp:111
Copyright 2026, Toyota Motor Corporation.
Definition array_exceptions_disabled.cpp:10