Re: Interval aggregate regression failure (expected seems

Поиск
Список
Период
Сортировка
От Greg Stark
Тема Re: Interval aggregate regression failure (expected seems
Дата
Msg-id 87irv4e002.fsf@stark.xeocode.com
обсуждение исходный текст
Ответ на Re: Interval aggregate regression failure (expected seems  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Interval aggregate regression failure (expected seems  (Gregory Maxwell <gmaxwell@gmail.com>)
Список pgsql-hackers
Tom Lane <tgl@sss.pgh.pa.us> writes:

> I think we can still file this as a compiler bug, because I'm pretty sure
> the C spec does not allow rearrangement of floating-point calculations ...

It may have more to do with whether the floating point value can stay in a
floating point register long enough to complete the calculation. 

IIRC, floating point registers are actually longer than a double so if the
entire calculation is done in registers and then the result rounded off to
store in memory it may get the right answer. Whereas if it loses the extra
bits on the intermediate values (the infinite repeating fractions) that might
be where you get the imprecise results.

It makes some sense that -mcpu and -march give the compiler enough information
to keep the intermediate results in registers more effectively.

-- 
greg



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: REL8_1_STABLE and HEAD
Следующее
От: Greg Stark
Дата:
Сообщение: Re: Interval aggregate regression failure (expected seems