I know what retyping does. But what I would like to know is how does it do that.
So I have this code
double n = 312.658328;
int x = (int)n;
if I statically assign the value like I did in this example, I can imagine that it could be compiler which does the conversion by cutting the number, but what if this happens runtime, with runtime calculated value.
Does it just resize the memory allocated to the variable, so that remaining bytes that don't fit into int are ignored and later rewritten by other data? Or does it produce some conversion code which recalculated the larger data which use floating point into smaller data with no floating point?