pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andrew Gierth <andrew@tao11.riddles.org.uk>
Cc: victor@magic.io
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #15519: Casting float4 into int4 gets the wrong sign instead of "integer out of range" error
Date: Fri, 23 Nov 2018 18:52:32 -0500
Message-ID: <15115.1543017152@sss.pgh.pa.us> (raw)
In-Reply-To: <87zhtzqs9o.fsf@news-spur.riddles.org.uk>
References: <15519-4fc785b483201ff1@postgresql.org>
	<874lc7sb1a.fsf@news-spur.riddles.org.uk>
	<13162.1543014227@sss.pgh.pa.us>
	<87zhtzqs9o.fsf@news-spur.riddles.org.uk>

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




view thread (12+ messages)  latest in thread

Message-ID: <15115.1543017152@sss.pgh.pa.us>
Permalink:  ../15115.1543017152@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/15115.1543017152@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, andrew@tao11.riddles.org.uk, victor@magic.io, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #15519: Casting float4 into int4 gets the wrong sign instead of "integer out of range" error
  In-Reply-To: <15115.1543017152@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox