Re: Slaying the HYPOTamus

Поиск
Список
Период
Сортировка
От Sam Mason
Тема Re: Slaying the HYPOTamus
Дата
Msg-id 20090824180456.GM5407@samason.me.uk
обсуждение исходный текст
Ответ на Re: Slaying the HYPOTamus  (Sam Mason <sam@samason.me.uk>)
Список pgsql-hackers
On Mon, Aug 24, 2009 at 06:59:38PM +0100, Sam Mason wrote:
> > On Mon, Aug 24, 2009 at 11:14:19PM +1000, Paul Matthews wrote:
> > >     if (x == 0.0)
> > >         return 0.0;
> > >     else {
> > >         yx = y/x;
> 
> is preventing a divide by zero on the line above.  So it's not a
> performance hack, it's just allowing it to remain correct as a result of
> changing the maths around.

I've also just realized why it's safe to return zero here; "y" contains
the smaller number and so if "x" is zero, "y" must be zero as well.

--  Sam  http://samason.me.uk/


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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: 8.5 release timetable, again
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Bug in date arithmetic