Possible comparison bug
Hi all,
There's a good one, which may have an obvious answer (and that's the reason I first decided to ask it here before filing a bug).
<cfset t1 = ToString("00237000000075384887")>
<cfset t2 = ToString("00237000000075384892")>
<cfif t1 EQ t2><cfoutput>#t1# equal to #t2#</cfoutput><cfelse><cfoutput>#t1# different to #t2#</cfoutput></cfif>
The result of the above is rather surprising. Somewhat this sort of comparison thinks the numbers are equal. Also, even if both numbers are converted to strings, ColdFusion still thinks they are equal.
If using Compare(t1,t2) however, ColdFusion starts comparing the strings as us, humans and distinguishes the difference between them ![]()
Now if there's any known limitation to comparing long numbers etc. or the fact that middle of each of them is filled with zeros affects it all, be welcome to point it out to me.
Simon
