I’m not sure anything particular is required for such cases? For example:
julia> x = typemax(UInt64)
0xffffffffffffffff
julia> (x >> 63) | 0x8000000000000000
0x8000000000000001
In Julia integer literal are automatically given a “big enough” type, at least up to 128-bit. So 0x8000000000000000
is a UInt64. You can request a specific type by writing e.g. UInt128(0x8000000000000000)
. But you get UInt128
automatically if you write a larger literal integer:
julia> typeof(0x1000000000000000000000000000000)
UInt128