tcl::mathfunc::isunordered inconsistency with some integer values
Closed / Fixed98006f00ac471be55d983d6a42606abc38f1d809Created 2 years agoUpdated 2 years ago
Descriptionplain2024-12-27 02:12:24
Tested on various windows builds only. isunordered unexpectedly returns 1 for a range of negative values when they are expressed in integer form. I'm not sure of the usecase for negative values here, but it doesn't seem to match the documentation as they should be promotable to floats, and as neither argument is NaN - the 1 returns are unexpected. %tcl::mathfunc::isunordered 1 -1.0 0 %tcl::mathfunc::isunordered 1 -1 1 This occurs for negative values expressed in integer form up to negative 2**52 for numbers below that - we again get a zero result. %tcl::mathfunc::isunordered 1 -4503599627370495 1 %tcl::mathfunc::isunordered 1 -4503599627370496 0
juliannoble2 Ticket [98006f00ac]: 3 changes
[History diff]2024-12-27 02:13:41
sebreswiki2024-12-27 21:23:22
Indeed, tcl::mathfunc::isunordered has mistakenly considered non-double numbers (e.g. int) as double.
Fixed for 8.7+, thanks for the report.
sebres Closed ticket [98006f00ac].
[History diff]2024-12-27 21:23:54
jan.nijtmanswiki2024-12-28 09:43:56
There are still test failures with MSVC on Windows
sebreswiki2024-12-28 14:09:06
Indeed, values of FP_* are compiler/implementation specific, e. g. for MSVC FP_NORMAL is equal -1, thus rewritten without FP_CLS_ERROR, because error-prone (whatever corrected value could still cross them later by some other platforms/compilers).
Fixed now in [3059fadfe6daf175].
Log in (anonymous is fine) to add a comment.