Re: power() function in Windows: "value out of range: underflow"

From: David Rowley <david(dot)rowley(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Huong Dangminh <huo-dangminh(at)ys(dot)jp(dot)nec(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>, Akio Iwaasa <aki-iwaasa(at)vt(dot)jp(dot)nec(dot)com>
Subject: Re: power() function in Windows: "value out of range: underflow"
Date: 2018-04-29 23:24:28
Message-ID: CAKJS1f91ZWgCUVbsprYMNwcOsWs9PwS_WLGyUcXAEJh9Y1c2rQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

On 30 April 2018 at 10:22, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> David Rowley <david(dot)rowley(at)2ndquadrant(dot)com> writes:
>> Wouldn't this machine have returned 1 before this patch though?
>
> No, don't think so, because it doesn't set EDOM for the case.
>
> Basically what we're doing here is making sure that we get results
> conforming to current POSIX even on machines that predate that
> standard. There are more of them floating around than I'd have
> expected, but it still seems like a good change to make. Maybe
> there's an argument for not back-patching, though?

I think we should back patch and try to be consistent about the
power(float8 1.0, 'NaN') and power('NaN', float8 0.0) cases. The
archives don't show any complaints about power() with NaN until this
one, so I imagine the number of people affected by this is small.
However, I think if we're willing to try to make MSVC consistent with
other platforms on this topic then there's no reason to draw the line
there and ignore other platforms that we claim to support.

POSIX seems like a good standard to follow for this in the absence of
guidance from the SQL standard.

--
David Rowley http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message PG Bug reporting form 2018-04-30 06:09:31 BUG #15179: Related to copy command
Previous Message Tom Lane 2018-04-29 22:22:42 Re: power() function in Windows: "value out of range: underflow"

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2018-04-29 23:42:52 Re: Postgres, fsync, and OSs (specifically linux)
Previous Message Michael Paquier 2018-04-29 23:06:08 Re: Cold welcoming message when installing anything because of LLVM bitcode stuff