From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Greg Stark <gsstark(at)mit(dot)edu> |
Cc: | Grzegorz Jaskiewicz <gj(at)pointblue(dot)com(dot)pl>, pgsql-hackers Hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: clang's static checker report. |
Date: | 2009-08-23 17:31:06 |
Message-ID: | 28388.1251048666@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Greg Stark <gsstark(at)mit(dot)edu> writes:
> On Sun, Aug 23, 2009 at 6:11 PM, Grzegorz Jaskiewicz<gj(at)pointblue(dot)com(dot)pl> wrote:
>> http://zlew.org/postgresql_static_check/scan-build-2009-08-23-5/report-MAVb5D.html#EndPath
>> for a very positive one - at least from strict language point of view.
>>
>> consider: float f = 100000000; f++; printf("%f\n", f);
> I believe the maximum value of the numbers involved here is the sample
> size which is currently capped at 10,000. But I'm not exactly sure.
No, the maximum value is somewhere around the maximum number of rows in
a table, which is on the rough order of 4e12, which is several orders of
magnitude below the threshold at which counting in a double becomes
inaccurate. It is, however, above the point at which counting in an
int32 will overflow. So the alternative would be to assume that we have
a working int64 data type, which doesn't strike me as an improvement
in the portability of the code.
regards, tom lane
From | Date | Subject | |
---|---|---|---|
Next Message | Grzegorz Jaskiewicz | 2009-08-23 18:31:39 | Re: clang's static checker report. |
Previous Message | Grzegorz Jaskiewicz | 2009-08-23 17:20:13 | Re: clang's static checker report. |