| From: | Jasen Betts <jasen(at)xnet(dot)co(dot)nz> |
|---|---|
| To: | pgsql-sql(at)postgresql(dot)org |
| Subject: | Re: Round integer division |
| Date: | 2010-06-26 13:18:30 |
| Message-ID: | i04un6$jc8$2@reversiblemaps.ath.cx |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-sql |
On 2010-06-25, Lee Hachadoorian <lee(dot)hachadoorian(at)gmail(dot)com> wrote:
>
>
> On 06/25/2010 07:00 PM, Scott Marlowe wrote:
>> That all floating point representations are approximate?
>>
> But if it's error due to approximation, shouldn't the result be random?
> I tried this for a handful of larger numbers, and it appears to
> consistently round to the even number. Wouldn't that have to be
> intentionally programmed that way?
Yes it is, an enginneer at intel made that decision in the 70s when
the 8087 coprocessor was developed.
If you're not running on x86-like hardware the round operation may
do something different.
| From | Date | Subject | |
|---|---|---|---|
| Next Message | silly sad | 2010-06-28 05:29:03 | Re: round(Numeric) |
| Previous Message | Jasen Betts | 2010-06-26 13:09:05 | Re: Round integer division |