Re: BUG #15519: Casting float4 into int4 gets the wrong sign instead of "integer out of range" error

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #15519: Casting float4 into int4 gets the wrong sign instead of "integer out of range" error
Дата
Msg-id 15115.1543017152@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: BUG #15519: Casting float4 into int4 gets the wrong sign instead of "integer out of range" error  (Andrew Gierth <andrew@tao11.riddles.org.uk>)
Ответы Re: BUG #15519: Casting float4 into int4 gets the wrong sign instead of "integer out of range" error  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: BUG #15519: Casting float4 into int4 gets the wrong sign instead of "integer out of range" error  (Andrew Gierth <andrew@tao11.riddles.org.uk>)
Список pgsql-bugs
Andrew Gierth <andrew@tao11.riddles.org.uk> writes:
> "Tom" == Tom Lane <tgl@sss.pgh.pa.us> writes:
>  Tom>      if (unlikely(num < (float4) INT_MIN || num >= (float4) INT_MAX || isnan(num)))

>     if (num < (float4)INT_MIN || num >= -(float4)INT_MIN || ...

Meh.  Seems to me that's relying on pretty much the same assumptions
and throwing in an extra dollop of obscurantism on top.

            regards, tom lane


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

Предыдущее
От: Andrew Gierth
Дата:
Сообщение: Re: BUG #15519: Casting float4 into int4 gets the wrong sign instead of "integer out of range" error
Следующее
От: Tom Lane
Дата:
Сообщение: Re: BUG #15519: Casting float4 into int4 gets the wrong sign instead of "integer out of range" error