Reputation: 11
if 52524302617.60 lss 9660035072 (echo WRONG) else (echo Correct!)
Returns WRONG each time.
Upvotes: 1
Views: 84
Reputation: 4574
It's a String compare and there is a max of character that are considered for compare.
as in the other answer by grawity it's only a numeric compare if both strings can be converted to integer and this assumes no decimal point and not more than 10 digits.
Upvotes: 0
Reputation: 16657
Arithmetics in the cmd
shell are limited to integers, and if
only performs numerical comparison if both sides consist entirely of digits.
Since 52524302617.60
has a .
in it, a string comparison is performed using lstrcmp()
.
Upvotes: 1