| От | Tom Lane |
|---|---|
| Тема | Re: NaN divided by zero should yield NaN |
| Дата | |
| Msg-id | 767348.1595288784@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Re: NaN divided by zero should yield NaN (Dean Rasheed <dean.a.rasheed@gmail.com>) |
| Список | pgsql-hackers |
Dean Rasheed <dean.a.rasheed@gmail.com> writes:
> On Thu, 16 Jul 2020 at 20:29, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> One thing that's not very clear to me is which of these spellings
>> is preferable:
>> if (unlikely(val2 == 0.0) && !isnan(val1))
>> if (unlikely(val2 == 0.0 && !isnan(val1)))
> My guess is that the first would be better, since it would tell the
> compiler that it's unlikely to need to do the NaN test,
Yeah, that's the straightforward way to think about it, but I've
found that gcc is sometimes less than straightforward ;-). Still,
there's no obvious reason to do it the second way, so I pushed the
first way.
regards, tom lane
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера