Adobe ColdFusion uses java.lang.Double to represent numbers in most cases, and it's a floating point representation. That means it stores a finite amount of precision about the number in question, and discards any bits beyond that. The stored precision is relative to the magnitude of the number. So if you ask it to store a HUGE integer, you'll start losing the right-most (ones, tens, hundreds, etc. columns). For example:
#11111111111111111 EQ 11111111111111111# #11111111111111111 EQ 11111111111111113# #111111111111111111 EQ 111111111111111113# #44444444444444444 EQ 44444444444444444# #44444444444444444 EQ 44444444444444443# #444444444444444444 EQ 444444444444444443#
You'd probably expect to get "YES NO NO YES NO NO" output to the page, but you'd be wrong. What you'll actually get is "YES YES NO YES NO YES".
What's the solution for comparing large integers like this? To compare them as strings:
#compare(11111111111111111, 11111111111111111) EQ 0# #compare(11111111111111111, 11111111111111113) EQ 0# #compare(111111111111111111, 111111111111111113) EQ 0# #compare(44444444444444444, 44444444444444444) EQ 0# #compare(44444444444444444, 44444444444444443) EQ 0# #compare(444444444444444444, 444444444444444443) EQ 0#
Running this code will give you "YES NO NO YES NO NO" – the desired result.
I believe Railo also uses java.lang.Double to represent numerics, so I'd expect it to have the same issue, though I didn't check.