Hello,
I am trying to make a little program, but I face a problem as described below.
Value-1 and Value-2 are data type short, Answ is data type integer; big enough to contain the answer of the multiplication of value-1 and value-2. But still I got an error message after the multiplication. If I change value-2 into data type integer everything goes alright.
Why? Can anybody help me?
Dim value-1 As Short = 165
Dim value-2 As Short = 2400
Dim answ As integer
Answ = value-1 * value-2
Reports the following error:
Additional information: Arithmetic operation resulted in an overflow.
In the debugger:
Constant expression not represent able in type 'Short'.
Thanks in advance
I am trying to make a little program, but I face a problem as described below.
Value-1 and Value-2 are data type short, Answ is data type integer; big enough to contain the answer of the multiplication of value-1 and value-2. But still I got an error message after the multiplication. If I change value-2 into data type integer everything goes alright.
Why? Can anybody help me?
Dim value-1 As Short = 165
Dim value-2 As Short = 2400
Dim answ As integer
Answ = value-1 * value-2
Reports the following error:
Additional information: Arithmetic operation resulted in an overflow.
In the debugger:
Constant expression not represent able in type 'Short'.
Thanks in advance