Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/tidbits.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1625,7 +1625,8 @@ int
coin_isinf(double value)
{
#ifdef HAVE_ISINF
return isinf(value);
if (std::isinf(value)) { return std::signbit(value) ? -1 : 1; }

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change actually fixes behavior here to match the documented function return value, which the previous version did not.

But upon an audit, this is not even used, at least on Linux, so there's not much risk of this correctness fix causing an issue.

return 0;
#elif defined(HAVE_FPCLASS)
if (fpclass(value) == FP_NINF) { return -1; }
if (fpclass(value) == FP_PINF) { return +1; }
Expand Down Expand Up @@ -1653,7 +1654,7 @@ int
coin_isnan(double value)
{
#ifdef HAVE_ISNAN
return isnan(value);
return std::isnan(value) ? 1 : 0;
#elif defined(HAVE__ISNAN)
return _isnan(value);
#elif defined(HAVE_FPCLASS)
Expand Down