Simple question that I can't find anywhere. When I'm doing arithmetic, it seems the natural type is to treat value as 16Bit Integers.
I'm trying to save the result of 60 * 60 * 8 * 5
into a long, but I get an Overflow
error before it even has a chance to save the number as a Long
:
Dim secondsInAWorkWeek As Long
secondsInAWorkWeek = 60 * 60 * 8 * 5
Long should happily store anything up to 2<sup>31</sup> = 2,147,483,647
How can I perform the multiplication safely to convert into a long