[Numpy-discussion] Test error with ATLAS, Windows 64 bit

Matthew Brett matthew.brett at gmail.com
Mon Apr 14 17:38:18 EDT 2014


Hi,

On Mon, Apr 14, 2014 at 2:02 PM, Julian Taylor
<jtaylor.debian at googlemail.com> wrote:
> The official numpy mingw binaries do not have all these math issues.
> Only the VC builds do.
> As mingw is fine the functions must be somewhere in the windows API but
> no-one has contributed a fix for the VC builds to numpy yet.

I'm building with mingw-w64.

It looks like this works as expected from this test:

#include <math.h>
#include <stdio.h>

int main() {
    double z;
    z = expm1(-0.0);
    printf("Result %f\n", z);
}

(prints -0).

as does this (modified from core/src/npymath/npy_math.c.src):

#include <stdio.h>

double npy_expm1(double x)
{
    if (isinf(x) && x > 0) {
        return x;
    }
    else {
        const double u = exp(x);

        if (u == 1.0) {
            return x;
        } else if (u - 1.0 == -1.0) {
            return -1;
        } else {
            return (u - 1.0) * x/log(u);
        }
    }
}

int main() {
    double z;
    z = npy_expm1(-0.0);
    printf("Result %f\n", z);
}

Sorry for my ignorance, but where does the `HAVE_EXPM1` symbol come from?

Cheers,

Matthew



More information about the NumPy-Discussion mailing list