Re: 128-bit integers can range only up to (2 ^ 63 -1)
От | jian he |
---|---|
Тема | Re: 128-bit integers can range only up to (2 ^ 63 -1) |
Дата | |
Msg-id | CACJufxFuoOo=dE4XXrOeUrn-zP07jg7g4GpSTE_rv5MPbhzOJg@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: 128-bit integers can range only up to (2 ^ 63 -1) (Tom Lane <tgl@sss.pgh.pa.us>) |
Ответы |
Re: 128-bit integers can range only up to (2 ^ 63 -1)
|
Список | pgsql-hackers |
On Tue, Jan 3, 2023 at 8:50 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
jian he <jian.universality@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 withlong long
integer less than 128 bits wide.
В списке pgsql-hackers по дате отправления: