M
Myles
Has anyone attempted to perform 182*182 operation in VBA? The followin
code generates an ovwerflow error in spite of the declarations.
Sub test()
Dim x as Long
x= 182*182 'overflow error on this line
Msgbox x
End sub
The problem persists even with a DOUBLE declaration for x. Treating
as a variant either by default (no declaration) or explicitly (b
declaration) doesn't help either.
As 181*181=32761, which reminds one of the magical figure 2 ^15 ther
must be some connection here.
What's happening ?
Myle
code generates an ovwerflow error in spite of the declarations.
Sub test()
Dim x as Long
x= 182*182 'overflow error on this line
Msgbox x
End sub
The problem persists even with a DOUBLE declaration for x. Treating
as a variant either by default (no declaration) or explicitly (b
declaration) doesn't help either.
As 181*181=32761, which reminds one of the magical figure 2 ^15 ther
must be some connection here.
What's happening ?
Myle