The result of 512*1024 becomes 0

Thank you for detailed explanation.

If calculation result is stored to unsigned variable, I should pay attention to signed value in the formula.

Thank you!