Tcl Source Code

View Ticket
Login
Ticket UUID: 87986108835a444a50dbee4ff693f67ce574a648
Title: TclIsInfinite(NaN) returns true for MSVC
Type: Bug Created on: 2023-04-08 21:51:59
Submitter: chrstphrchvz Assigned to: nobody
Subsystem: 52. Portability Support Severity: Minor
Priority: 5 Medium Last modified: 2023-04-08 21:51:59
Status: Open Closed by: nobody
Resolution: None Closed on:
Version: 8.6.13
Description:

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?