The problem is that although you are using a 64bit data type, your calculations are using 32bit values, so you are encountering integer overflow. 140417 * 100000
is 14041700000 (0x344F356A0) in 64bit, but is 1156798112 (0x44F356A0) in 32bit. As you can see, 0x300000000 is being truncated off of the result, as it does not fit in a 32bit value.
You need to ensure that you are using 64bit calculations, eg:
typedef unsigned long long ulong64_t;
int main()
{
ulong64_t val = 0;
val = ulong64_t(140417) * ulong64_t(100000) + 92 + 1;
}
Alternatively, use integer constant suffixes:
int main()
{
unsigned long long val = 0;
val = 140417i64 * 100000i64 + 92 + 1;
}
Or:
int main()
{
unsigned long long val = 0;
val = 140417ull * 100000ull + 92 + 1;
}