Your not really describing what your problem is.
I am going to let you in on a little secret, real programmers don't bother to save every teeny tiny bit here and there.
If you designing an object that might have millions of instantiation... well then I might understand if you used shorts when you don't need the capacity.
Mixing data types is generally a pain in C/Java like languages because there are strict rules that govern how the compiler will do things. You end up sending explicit casting instructions (which waste time) and don't end up with the hugest performance or space gains. And casting makes your code ugly... really ugly.
In an object with 10 members if you make one of them a short, you only save a few bytes. Even with millions of them your only saving some constant multiple of space. It might sound important but in the big scheme of things these aren't the make or break performance determinants. The exception being realtime/interactive applications.
In this case I would say just use floats throughout. If this were Java I would say doubles.
__________________
"It better be funny"
|