Make sure that no integer overflow could occur during scaling (defensive coding)