Re: [Patch] Log10 and hyperbolic functions for SQL:2016 compliance

Поиск
Список
Период
Сортировка
От Lætitia Avrot
Тема Re: [Patch] Log10 and hyperbolic functions for SQL:2016 compliance
Дата
Msg-id CAB_COdg_DVjTn88Wo2iPPaFqtp4WvVKvph26VEG-UCSJfa9vFg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [Patch] Log10 and hyperbolic functions for SQL:2016 compliance  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Ответы Re: [Patch] Log10 and hyperbolic functions for SQL:2016 compliance  (Andrew Gierth <andrew@tao11.riddles.org.uk>)
Список pgsql-hackers
Hi Alvaro,

Thank you so much for taking the time to review the patch and for taking the time again to sort things
out with me this evening.



I see that in dtanh() you set errno to 0 before calling tanh(), but 1)
you don't check for it afterwards (seems like you should be checking for
ERANGE, as well as checking the return value for isinf()), and 2) you
don't do that in dsinh() and dcosh() and I'm not quite sure I see why.
What's up with that?


At the time I wrote that patch, I tried to include errno testing.Then, I think again and 
came back with the wrong idea everything would be fine.

By re-reading math.h documentation, it is now clear that the three functions can raise a 
ERANGE error.

There are two cases :
- range error due to overflow occurs.
- range error occurs due to underflow. In that case, the correct result (after rounding) is returned. So I assume we can ignore that case.

For sinh and cosh, we can have both cases and we added support for overflow.

For tanh, the only possible case is underflow and then, the result is correct.

We included comments to explain errno handling in those functions.

Cheers,

Lætitia
Вложения

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

Предыдущее
От: David Rowley
Дата:
Сообщение: Re: ATTACH/DETACH PARTITION CONCURRENTLY
Следующее
От: Noah Misch
Дата:
Сообщение: Synchronize with imath upstream