On Tue, Aug 28, 2012 at 3:20 PM, Steven Degutis <
sdeg...@8thlight.com> wrote:
> When are there ever cases in which you don't care about the precision of
> some variable?
It's not about not caring about the precision of some variable. it's
only about not caring if the variable is 32bit or 64 bit.
In many cases it doesn't matter (e.g. in almost any place where the
expected value fit in the 32 range):
- "Small number of loops" cycles are quite common.
- Value used to index many "small" arrays/slices/strings.
- The value_of_index from range statement 'var i int; for i = range blah {}'
- Many other, which don't come to my mind immediately.
And then, on some CPUs the 32b things/operations can be slower than
the same for 64b. OTOH, 64b on 32b CPU can be also slower. So isn't it
better to have 'int' tailored to the machine where the program is run?
-j