Hello,
This is what I did:
UINT n= 1<<31
string s=numtostr(n);
when I display the string I see -2147483648
Why is the sign negative the result should be positive and the variable type is UINT
Can someone explain this please
Thanks,
Haim
Use the sprint funtion or the using command with the "u" modifier.
print( using("%u#",n) );
Paul.
Thanks Paul.
Can I be sure that the issue is only with the display and that the value itself is correct?
Haim
The value itself is correct of course. NumToStr accepts a DOUBLE as it's parameter, so your UINT becomes signed during the conversion.
Paul.
Thanks for the clarification.