int a = 200000;
double b = (double) (a*a);
I would like to be able to calculate if (aa) (integers) is already too large (stackOverflow) to hold in the variable; in this case I know that multiplying (aa) leads to an int that will not fit -> the number will be wrong;
What I do not understand is how I can calculate this off the top of my head. How can I see if a value will not fit in an int variable??
Is there a way to do this without using methods, by just using the plain code and common sense? ;-)
Best regards,
Wouter