[uint32] Unsigned Integers Taking Negative Values

Hello,

The following code in C++ outputs negative integers to the outputlog. I have also tried using unsigned int to no avail. I am incredibly annoyed and frustrated by this problem.

uint32 somePosNum = 0;
somePosNum += 100;
UE_LOG(LogTemp, Warning, TEXT("%d"), somePosNum);
somePosNum -= 300;
UE_LOG(LogTemp, Warning, TEXT("%d"), somePosNum);

Prints this screen:

I don’t know what I should be doing…

what you trying to do btw ?

You log your unsigned int using “%d” template. d - Signed decimal integer
So you convert your unsigned int to signed and then log it.

If you want to log unsigned int - you must use “%u”