Re: Perl's newSViv() versus 64-bit ints?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Salvador Fandiño <sfandino(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Perl's newSViv() versus 64-bit ints?
Date: 2016-03-12 15:47:38
Message-ID: 12808.1457797658@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

=?UTF-8?Q?Salvador_Fandi=c3=b1o?= <sfandino(at)gmail(dot)com> writes:
> Another possibility is to just use newSVnv(), but NVs are not
> able to represent all the uint64 range precisely (IIRC, they can
> represent integers up to 48bits?).

[ looks... ] Oh, NV is a "double", which I think would be a perfectly
reasonable choice: it'd be exact up to about 2^53, on most machines,
which should be plenty for a long time to come.

How much of a user-visible change would that be, if the "processed"
field of a spi_exec_query() result started coming back as an NV not
an IV? I'm not sure how much that would affect semantics in typical
Perl code.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2016-03-12 15:51:39 Re: Performance improvement for joins where outer side is unique
Previous Message Daniel Verite 2016-03-12 15:34:07 Re: [patch] Proposal for \crosstabview in psql