This seems like a very simple problem that I can't find any information on. A simplified version of the code - I have a larger script as part of a maths problem which uses the number '6008514752' as an input:
This returns an Overflow error. Why does VB6 add the '#' automatically to this number? I understand that this forces x to be a double, and from what I've been reading some operations in VB require double accuracy. I used 'Variant' because the number is outside the 9-digit range for 'Long'. Should I be using something else? Does it matter here?
I'm also confused as to why
does not return an overflow if the mod operator does.
Code:
Dim x As Variant
x = 6008514752#
Debug.Print x Mod 2
I'm also confused as to why
Code:
Debug.Print x