<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Apr 14, 2014 at 3:38 PM, Matthew Brett <span dir="ltr"><<a href="mailto:matthew.brett@gmail.com" target="_blank">matthew.brett@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br>
<div class=""><br>
On Mon, Apr 14, 2014 at 2:02 PM, Julian Taylor<br>
<<a href="mailto:jtaylor.debian@googlemail.com">jtaylor.debian@googlemail.com</a>> wrote:<br>
> The official numpy mingw binaries do not have all these math issues.<br>
> Only the VC builds do.<br>
> As mingw is fine the functions must be somewhere in the windows API but<br>
> no-one has contributed a fix for the VC builds to numpy yet.<br>
<br>
</div>I'm building with mingw-w64.<br>
<br>
It looks like this works as expected from this test:<br>
<br>
#include <math.h><br>
#include <stdio.h><br>
<br>
int main() {<br>
    double z;<br>
    z = expm1(-0.0);<br>
    printf("Result %f\n", z);<br>
}<br>
<br>
(prints -0).<br>
<br>
as does this (modified from core/src/npymath/npy_math.c.src):<br>
<br>
#include <stdio.h><br>
<br>
double npy_expm1(double x)<br>
{<br>
    if (isinf(x) && x > 0) {<br>
        return x;<br>
    }<br>
    else {<br>
        const double u = exp(x);<br>
<br>
        if (u == 1.0) {<br>
            return x;<br>
        } else if (u - 1.0 == -1.0) {<br>
            return -1;<br>
        } else {<br>
            return (u - 1.0) * x/log(u);<br>
        }<br>
    }<br>
}<br>
<br>
int main() {<br>
    double z;<br>
    z = npy_expm1(-0.0);<br>
    printf("Result %f\n", z);<br>
}<br>
<br>
Sorry for my ignorance, but where does the `HAVE_EXPM1` symbol come from?<br>
<div class=""><div class="h5"><br></div></div></blockquote><div><br></div><div>Remember all configuration output at the beginning of the build? One of those tries to link 'expm1{f, , l}' and sets the value of 'HAVE_EXPM1{F,,L}' accordingly. You can find the result in the `config.h` file in the build directory.<br>
<br></div><div>Chuck<br></div><br></div></div></div>