However, if I implicitly or explicitly convert it to a uint, the number becomes 2147483647 (0x7FFFFFFF), even though the real value is within the valid range for a uint.
To overcome the issue, I can cast 2 times as below:
Code: Select all
// dTestVar is the double read in from the database
uint uTestVar = uint(uint64(dTestVar))