Reminds me on bash, where I also have to prefix values to compare with x, to be able to handle empty vars.
if [ x$1 == x$2 ];
But automatic string to float conversion is just crazy, esp. in comparison context. Perl, which is equally soft, has at least numerical and string comparison operators. $ perl -e'print "0e462097431906509019562988736854" ==
"0e830400451993494058024219903391"'
1
$ perl -e'print "0e462097431906509019562988736854" eq
"0e830400451993494058024219903391"'
So the solution is to use === which does not compare references with strings but the values, or the strcmp function. And refrain from using == with strings at all.
'0XAB' == '0xab' is true.
Comparing any string to 0 with == will return true.