i'm trying to define a constant in Delphi:
const
FNV_offset_basis = 14695981039346656037;
And i get the error: Integer constant too large
Note:
14,695,981,039,346,656,037
decimal is equal to0x14650FB0739D0383
hex.
How can i declare this Int64
constant?
Some other things i've tried:
const
FNV_offset_basis: Int64 = 14695981039346656037;
FNV_offset_basis = Int64(14695981039346656037);
FNV_offset_basis: Int64 = Int64(14695981039346656037);
var
offset: LARGE_INTEGER;
begin
//recalculate constant every function call
offset.LowPart = $739D0383;
offset.HighPart = $14650FB0;
Correction
My fundamental assumption was wrong.
Pasting 14695981039346656037
into Windows 7 Calculator, and converting to hex, led me to believe that the hex equivalent of 14695981039346656037
is 0x14650FB0739D0383
:
That is incorrect.
So when i saw a 16-digit hex value, with the high bit not set, i presumed it could fit in a 64-bit signed integer.
In reality the hex equivalent of 14695981039346656037
is...something else. Rob, you were right! (probably)