-
I read in the MSDN library that a long data type should be used whenever possible because it is the processors native data type and therfore more efficient. Why is this if it's 4 bytes and the integer is 2 bytes?
Also, it sayed you should only use decimal when absolutely neccessary when dealing with math so that the math co-proccessor is utilized less. What data type can I use that when divided by an indivisable value won't return a decimal value? I usually use the round() functiln.
Any help would be great thanks.
-
byte, integer and Long data types will not return the decimal part of a number. it rounds the number to the nearest whole number.
-
Use the \ as devide-thingie (whatever that's called in English...)
5 / 2 = 2,5
5 \ 2 = 2
-
Longs are 32bit wide (2^32) = +/- 2147483648 as the processor and memory are internally 32bit it is quicker to use this type.
A integer is 16bit (2^16) = +/- 32768.
A byte is 8 bits (though I guess you knew that!)
[This message has been edited by Rick H (edited 01-19-2000).]