From: Jasen Betts <jasen@xnet.co.nz>
To: pgsql-sql@postgresql.org
Subject: Re: Round integer division
Date: 26 Jun 2010 13:18:30 GMT
Message-ID: <i04un6$jc8$2@reversiblemaps.ath.cx> (raw)
References: <4C25334D.4040805@gmail.com>
<AANLkTinq3e-fl89_zIdEShmhK2KnUUpZZjUAYhHVnWqr@mail.gmail.com>
<4C2536BC.4090306@gmail.com>
On 2010-06-25, Lee Hachadoorian <lee.hachadoorian@gmail.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.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: jasen@xnet.co.nz
Subject: Re: Round integer division
In-Reply-To: <i04un6$jc8$2@reversiblemaps.ath.cx>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox