If have this situation:

int baseValue = (3 * value) / 100

and use this value in various cases.

int width = baseValue;
int height = baseValue;
int length = baseValue;

Exist something of difference, of do this more of one time? (This is not case, only ask by question of doubt)

ex:

int width = (3 * value) / 100;
int height = (3 * value) / 100;
int length = (3 * value) / 100;

in all cases the result be the same

Would use more processing in this case?

Thanks...

有帮助吗?

解决方案

allocating a variable takes less processing than calculating the same again I think, might help you to try to understand how this on byte level works. But why do you ask such a question? If you're interested in the answer just make a test program and log the times.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top