Those values would each fit in a byte, why use a short?
This is the part we've been asking about. What are the "adjustment"s you are talking about?
Half of a long can hold 4B, vs the 900M...
Type: Posts; User: Norm
Those values would each fit in a byte, why use a short?
This is the part we've been asking about. What are the "adjustment"s you are talking about?
Half of a long can hold 4B, vs the 900M...
You can't. A char has 2 bytes with 64K possible values. A byte has 256 values.
No, a double will be more precise. It depends on how many significant digits you need.
Why do they both need...
Its hard to offer advice if we don't know What you are trying to do?
You're coding a lot without explaining the objective.
As helloworld922 said:
Are you trying to pack two numbers with 500K...
If 333333 is the max for one value and 100000 for the other, you could pack them into a long (8 bytes) with no loss of precision.
Your data appears to require 5 bytes to hold the two values.
Pack...
Can you explain the program requirement for all that? What is it you are trying to do?
It looks like you are trying to store 3 data values in one variable of type double.
What are the ranges in...
Do you mean an array holding a million int? For example:
int[] bigArray = new int[1000000000];
How much memory are you worried about?
How many decimal places can a float hold? Is it enough for your app?