Variant Currency comparison bug

Consider this code:

dim c1 as currency = 0
dim c2 as currency = 10

dim v1 as variant = c1
dim v2 as variant = c2

if v1 < v2 then
// This works
end if

c2 = 214749
v2 = c2
if v1 < v2 then
// FAILS!!
end if

If the spread between the currency values is > 214,768, the Variant comparison will not work property.

Wait, there’s more. It seems to be a multiple thing. I tested from 0 to 10 million, and found that these ranges work. Everything outside these ranges do not work.

1 - 214748
429497 - 644245
858994 - 1073741
1288491 - 1503238
1717987 - 1932735
2147484 - 2362232
2576981 - 2791728
3006478 - 3221225
3435974 - 3650722
3865471 - 4080218
4294968 - 4509715
4724465 - 4939212
5153961 - 5368709
5583458 - 5798205
6012955 - 6227702
6442451 - 6657199
6871948 - 7086696
7301445 - 7516192
7730942 - 7945689
8160438 - 8375186
8589935 - 8804682
9019432 - 9234179
9448929 - 9663676

Off to file Feedback.

<https://xojo.com/issue/43897>

With 4 implied decimals, 2147480000 looks suspiciously like signed integer rollover.

It sure does. I bet if I had drilled down to the decimals, I would have gotten the full thing.