Skip to content
Tcl Source Code View Ticket
Login

View Ticket

TclIsInfinite(NaN) returns true for MSVC

Open87986108835a444a50dbee4ff693f67ce574a648Created 4 years agoUpdated 4 years ago
Descriptionwiki2023-04-08 21:51:59
In tclInt.h (8.6.13):
#ifdef _MSC_VER
#    define TclIsInfinite(d)	(!(_finite((d))))
…
#else
#    define TclIsInfinite(d)	((d) > DBL_MAX || (d) < -DBL_MAX)

The definition used for MSVC will erroneously return true for NaN, inconsistent with the definition on other platforms and the definition in Tcl 8.7 (which deprecates this macro):

#   define TclIsInfinite(d)	isinf(d)

Should the macro be corrected?

Log in (anonymous is fine) to add a comment.