Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2023-04-08
22:12 • New ticket [d6d8509933] Tcl_InitBignumFromDouble() does not check for NaN. artifact: 8ab6f672df user: chrstphrchvz
21:51 • New ticket [8798610883] TclIsInfinite(NaN) returns true for MSVC. artifact: 8360a6f4c2 user: chrstphrchvz

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.