I don't see why that would be relevant: the issue is that uVal%10 was coming out negative, where uVal is an unsigned int.