On Tue, Jan 3, 2023 at 8:50 PM Tom Lane <t...@sss.pgh.pa.us> wrote: > jian he <jian.universal...@gmail.com> writes: > > I am slightly confused by the int128 type. I thought the 128 bit integer > > means range type will be upto 2 ^ 127 - 1. > > Now just copy the above code and test the int128 range. > > int128 can only up to 9223372036854775807 (2 ^ 63 -1). > > What's your grounds for claiming that? > > regards, tom lane >
I did something like int128 a1 = 9223372036854775807 + 1; I also did something like int128 a1 = (int128)9223372036854775807000; I misread the warning. I should do the cast first. The second expression has a warning. I guess because > There is no support in GCC for expressing an integer constant of type > __int128 for targets with long long integer less than 128 bits wide. > https://gcc.gnu.org/onlinedocs/gcc/_005f_005fint128.html