Re: Re: BUG #12885: The result of casting a double to an integer depends on the database version

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Pedro Gimeno <pgsql-004(at)personal(dot)formauri(dot)es>
Cc: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, rschaaf(at)commoninf(dot)com, pgsql-bugs(at)postgresql(dot)org
Subject: Re: Re: BUG #12885: The result of casting a double to an integer depends on the database version
Date: 2015-03-25 17:57:53
Message-ID: 8192.1427306273@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Pedro Gimeno <pgsql-004(at)personal(dot)formauri(dot)es> writes:
> The previous version left out a corner case. Attached is a function and
> test suite to deal with it.

Hmm ... I'm thinking we probably should explicitly check for inf and NaN,
no?

if (isnan(x) || isinf(x))
return x;

It's possible the given coding would return this result anyway by
accident, but that seems rather fragile.

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Pedro Gimeno 2015-03-25 18:27:35 Re: Re: BUG #12885: The result of casting a double to an integer depends on the database version
Previous Message Pedro Gimeno 2015-03-25 17:39:12 Re: Re: BUG #12885: The result of casting a double to an integer depends on the database version