[+cc martynas in case you don't read tech@]

On 2014-06-02, Daniel Dickman <didick...@gmail.com> wrote:
> I hit this problem while working with the numpy 1.8.1 regress suite
> which has some tests that are currently failing.
>
> Here is a reduced test case of the logaddexp2 python function which
> ends up calling exp2. Is this a bug in the openbsd exp2
> implementation?
>
> ---8<---
> #include <stdio.h>
> #include <stdlib.h>
> #include <math.h>
>
> int main(void) {
>         double x;
>         double y;
>
>         // x = log2(5)
>         x = 2.32192809489;
>         // y = 2**(log2(5))
>         y = exp2(x);
>
>         printf("expected: 5.0\n");
>         printf("actual:   %f\n", y);
>
> ---8<---
>
> on a linux/x86_64 machine:
>
> # gcc -lm test.c && ./a.out
> expected: 5.0
> actual:   5.000000
>
> on an openbsd/i386 machine:
>
> # gcc -lm test.c && ./a.out
> expected: 5.0
> actual:   4.994404

I don't know whether it's a bug, but fwiw here are results on some
other OpenBSD arch:

amd64   5.000000
i386    4.994404
macppc  5.000000

Reply via email to