Why VB append a # on my statement?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I am puzzled by the fact that VBA append a # at the end of my programming
statement.

Dim val as Double

val = 0.5 + 10000000000# <- the # appended by VBA after the 10th zero (the
11th digit)

however

val = 0.5 + 1000000000 <- no problem if only contain 9 zeros (10 digits)

thank you
 
The "#" signifies that the literal value is being compiled as a Double and
not the default Long, because 1E10 (10,000,000,000) is too large to be
stored in a Long.
 
Back
Top