Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2024-12-28
14:09 • Closed ticket [98006f00ac]: tcl::mathfunc::isunordered inconsistency with some i... artifact: 7faff67425 user: sebres
13:58
amend to [98006f00ac471be5]: fixes MSVC build (values of FP_* are compiler/implementation specific, ... check-in: 3059fadfe6 user: sebres tags: core-8-branch
09:43 • Open ticket [98006f00ac]: tcl::mathfunc::isunordered inconsistency with some int... artifact: 5481f99519 user: jan.nijtmans
01:00
merge 8.7: amend to [98006f00ac471be5] - simplification and deduplication, better tests check-in: 2ef804f95d user: sebres tags: trunk, main
00:58
expr.test: amend to [98006f00ac471be5] - tests simplification and deduplication, big matrix for isun... check-in: 1b2b6d08bb user: sebres tags: core-8-branch
2024-12-27
23:23
amend to [98006f00ac471be5]: code simplification and deduplication check-in: 261c3bd222 user: sebres tags: core-8-branch
21:23 • Closed ticket [98006f00ac]: tcl::mathfunc::isunordered inconsistency with some i... artifact: de5a121519 user: sebres
21:23 • Ticket [98006f00ac]: 4 changes artifact: af5ab0551f user: sebres
21:20
merge 8.7 (fixes [98006f00ac471be5]) check-in: 17b5c7a6ce user: sebres tags: trunk, main
21:19
amend to fix [98006f00ac471be5]: typo check-in: ea993b9387 user: sebres tags: core-8-branch
21:17
fixes [98006f00ac471be5] tcl::mathfunc::isunordered mistakenly considered non-double numbers (e.g. i... check-in: e749604467 user: sebres tags: core-8-branch
21:15
tcl::mathfunc::isunordered: extended test illustrating [98006f00ac471be5] check-in: baaeb4d070 user: sebres tags: core-8-branch
02:13 • Ticket [98006f00ac] tcl::mathfunc::isunordered inconsistency with some negative ... artifact: 1b1ff01cea user: juliannoble2
02:12 • New ticket [98006f00ac]. artifact: 06c7890735 user: juliannoble2

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.