Version 7 of ==

Updated 2018-07-12 02:55:11 by CecilWesterhof

expr numeric equality operator

Uses string equality if either of the arguments cannot be interpreted as numeric, but if you actually want string equality, use the eq operator instead.

% expr {  1 == 2  }
0
% expr {  1 == 1  }
1
% expr {  0x1f == 31  }
1

To show you should be careful comparing floats:

% expr { 1 == 1.0000000000000001110223 }
1

Comparing with zero is a lot safer:

expr { 0 == 0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001 }
0

but

expr { 0 == 0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001 }
1

So from 1E-324 Tcl does not see the difference with zero any-more.