[Numpy-discussion] Test error with ATLAS, Windows 64 bit
Charles R Harris
charlesr.harris at gmail.com
Mon Apr 14 17:58:41 EDT 2014
On Mon, Apr 14, 2014 at 3:38 PM, Matthew Brett <matthew.brett at gmail.com>wrote:
> 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?
>
>
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.
Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20140414/4b025108/attachment.html>
More information about the NumPy-Discussion
mailing list