Skip to content

Commit 8de0ae6

Browse files
authored
Refactor is_NaN function to use std::fpclassify
1 parent 2936521 commit 8de0ae6

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/xtd.core/include/xtd/box_floating_point.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ namespace xtd {
8787
/// @brief Returns a value indicating whether the specified number evaluates to not a number.
8888
/// @param value A floating-point number.
8989
/// @return `true` if value evaluates to not a number; otherwise, `false`.
90-
[[nodiscard]] static auto is_NaN(type_t value) noexcept -> bool {return value != value;}
90+
[[nodiscard]] static auto is_NaN(type_t value) noexcept -> bool {return std::fpclassify(value) == FP_NAN;}
9191

9292
/// @brief Returns a value indicating whether the specified number evaluates to negative infinity.
9393
/// @param value A floating-point number.

0 commit comments

Comments
 (0)