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

From: Euler Taveira <euler(at)timbira(dot)com(dot)br>
To: David Rowley <david(dot)rowley(at)2ndquadrant(dot)com>
Cc: Huong Dangminh <huo-dangminh(at)ys(dot)jp(dot)nec(dot)com>, "pgsql-bugs(at)lists(dot)postgresql(dot)org" <pgsql-bugs(at)lists(dot)postgresql(dot)org>, 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-11 04:10:29
Message-ID: CAHE3wgh5HhBiZJonWuJo7oXS41v6T5nYnQ1TVop0TK9T0AzDfw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

2018-04-11 0:13 GMT-03:00 David Rowley <david(dot)rowley(at)2ndquadrant(dot)com>:
> I can recreate this when building with MSVC 2012. I confirm that I see
> the same as you. Microsoft are setting errno to EDOM in the above 3
> cases, where in Linux the result is still NaN, just the errno is not
> set.
>
FWIW, I tested in MSVC 2017 (15.6.4) and it worked like expected.
Looking at [1], it seems there could be nasty bugs when using math
functions in MSVC < 2013 (or 2015). I don't have some older MSVC here
to try /fp:OPTIONHERE [2] to see if it makes any difference.

[1] https://docs.microsoft.com/en-us/cpp/porting/floating-point-migration-issues
[2] https://msdn.microsoft.com/pt-br/library/e7s85ffb.aspx

--
Euler Taveira Timbira -
http://www.timbira.com.br/
PostgreSQL: Consultoria, Desenvolvimento, Suporte 24x7 e Treinamento

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Huong Dangminh 2018-04-11 04:42:04 RE: power() function in Windows: "value out of range: underflow"
Previous Message Michael Paquier 2018-04-11 03:30:24 Re: BUG #15105: OpenTransientFile() should be paired with CloseTransientFile() rather than close()

Browse pgsql-hackers by date

  From Date Subject
Next Message Kyotaro HORIGUCHI 2018-04-11 04:20:23 Re: Boolean partitions syntax
Previous Message David Rowley 2018-04-11 03:13:35 Re: power() function in Windows: "value out of range: underflow"