While looking into a way to speed up the filling of an array of one million elements (type Single), I came across something I never knew about which I thought others may be able to use in the future.

I have tested the first of these on a large array of Integers and I noticed no difference in the speed at all. I guess I have to do more like a billion operations before I'd notice a difference OR this is not the way it is done in VB...

The only difference I did notice was that if I changed my array to type Double, I had an improvement in the time to fill the array. This would be due to VB not having to convert the result from Double to Single in order to fit my array (see note 2).

From "Microsoft Office 2000/Visual Basic Programmer's Guide"

Mathematical Operations
The following points provide suggestions for ways to speed up operations on numbers:

When performing division on integers, use the integer division operator (\) rather than the floating-point division operator (/), which always returns a value of type Double regardless of the types of the numbers being divided.


Keep in mind that any time you use a Single or Double value in an arithmetic expression with integer values, the integers are converted to Single or Double values, and the final result is a Single or Double value. If you're performing several operations on a number that is the result of an arithmetic operation, you may want to explicitly convert the number to a smaller data type.
Cheers