diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2013-08-02 20:23:29 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2013-08-02 20:23:29 +0000 |
commit | 28520ac66a84f7aaf6ac8a46870aa99518c267b3 (patch) | |
tree | a24c1e2b2e2638f9cb4f096820754c2114f7add5 /regress/lib | |
parent | 4ba7611e62ec153bb15bb00eaef0a16d52e8235d (diff) |
Fix a couple of corner cases in the implementation of pow(3) to make it
compatible with C99. Most notably:
- 1**y == 1, even if y is NaN
- (-1)**+-Inf == 1
and adjust the cephes testsuite to test for the right thing here.
ok martynas@
Diffstat (limited to 'regress/lib')
-rw-r--r-- | regress/lib/libm/cephes/testvect.c | 12 | ||||
-rw-r--r-- | regress/lib/libm/cephes/testvectl.c | 12 | ||||
-rw-r--r-- | regress/lib/libm/cephes/testvectll.c | 12 |
3 files changed, 18 insertions, 18 deletions
diff --git a/regress/lib/libm/cephes/testvect.c b/regress/lib/libm/cephes/testvect.c index 638320074e7..5bb328205aa 100644 --- a/regress/lib/libm/cephes/testvect.c +++ b/regress/lib/libm/cephes/testvect.c @@ -1,4 +1,4 @@ -/* $OpenBSD: testvect.c,v 1.1 2011/05/30 20:23:35 martynas Exp $ */ +/* $OpenBSD: testvect.c,v 1.2 2013/08/02 20:23:28 kettenis Exp $ */ /* * Copyright (c) 2008 Stephen L. Moshier <steve@moshier.net> @@ -332,12 +332,12 @@ static struct twoarguments test2[] = {"pow", pow, &MINF, &MTHREE, &MZERO, 0}, {"pow", pow, &MINF, &MTWO, &ZERO, 0}, {"pow", pow, &NAN, &ONE, &NAN, 0}, - {"pow", pow, &ONE, &NAN, &NAN, 0}, + {"pow", pow, &ONE, &NAN, &ONE, 0}, {"pow", pow, &NAN, &NAN, &NAN, 0}, - {"pow", pow, &ONE, &INF, &NAN, 0}, - {"pow", pow, &MONE, &INF, &NAN, 0}, - {"pow", pow, &ONE, &MINF, &NAN, 0}, - {"pow", pow, &MONE, &MINF, &NAN, 0}, + {"pow", pow, &ONE, &INF, &ONE, 0}, + {"pow", pow, &MONE, &INF, &ONE, 0}, + {"pow", pow, &ONE, &MINF, &ONE, 0}, + {"pow", pow, &MONE, &MINF, &ONE, 0}, {"pow", pow, &MTWO, &HALF, &NAN, 0}, {"pow", pow, &ZERO, &MTHREE, &INF, 0}, {"pow", pow, &MZERO, &MTHREE, &MINF, 0}, diff --git a/regress/lib/libm/cephes/testvectl.c b/regress/lib/libm/cephes/testvectl.c index 2f4355764bb..c0436eb6263 100644 --- a/regress/lib/libm/cephes/testvectl.c +++ b/regress/lib/libm/cephes/testvectl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: testvectl.c,v 1.2 2011/07/08 16:49:05 martynas Exp $ */ +/* $OpenBSD: testvectl.c,v 1.3 2013/08/02 20:23:28 kettenis Exp $ */ /* * Copyright (c) 2008 Stephen L. Moshier <steve@moshier.net> @@ -325,12 +325,12 @@ static struct twoarguments test2[] = {"powl", powl, &MINFL, &MTHREEL, &NEGZEROL, 0}, {"powl", powl, &MINFL, &MTWOL, &ZEROL, 0}, {"powl", powl, &NANL, &ONEL, &NANL, 0}, - {"powl", powl, &ONEL, &NANL, &NANL, 0}, + {"powl", powl, &ONEL, &NANL, &ONEL, 0}, {"powl", powl, &NANL, &NANL, &NANL, 0}, - {"powl", powl, &ONEL, &INFINITYL, &NANL, 0}, - {"powl", powl, &MONEL, &INFINITYL, &NANL, 0}, - {"powl", powl, &ONEL, &MINFL, &NANL, 0}, - {"powl", powl, &MONEL, &MINFL, &NANL, 0}, + {"powl", powl, &ONEL, &INFINITYL, &ONEL, 0}, + {"powl", powl, &MONEL, &INFINITYL, &ONEL, 0}, + {"powl", powl, &ONEL, &MINFL, &ONEL, 0}, + {"powl", powl, &MONEL, &MINFL, &ONEL, 0}, {"powl", powl, &MTWOL, &HALFL, &NANL, 0}, {"powl", powl, &ZEROL, &MTHREEL, &INFINITYL, 0}, {"powl", powl, &NEGZEROL, &MTHREEL, &MINFL, 0}, diff --git a/regress/lib/libm/cephes/testvectll.c b/regress/lib/libm/cephes/testvectll.c index 37e4f81dc80..b4984344785 100644 --- a/regress/lib/libm/cephes/testvectll.c +++ b/regress/lib/libm/cephes/testvectll.c @@ -1,4 +1,4 @@ -/* $OpenBSD: testvectll.c,v 1.2 2011/07/08 16:49:05 martynas Exp $ */ +/* $OpenBSD: testvectll.c,v 1.3 2013/08/02 20:23:28 kettenis Exp $ */ /* * Copyright (c) 2008 Stephen L. Moshier <steve@moshier.net> @@ -328,12 +328,12 @@ static struct twoarguments test2[] = {"powl", powl, &MINFL, &MTHREEL, &NEGZEROL, 0}, {"powl", powl, &MINFL, &MTWOL, &ZEROL, 0}, {"powl", powl, &NANL, &ONEL, &NANL, 0}, - {"powl", powl, &ONEL, &NANL, &NANL, 0}, + {"powl", powl, &ONEL, &NANL, &ONEL, 0}, {"powl", powl, &NANL, &NANL, &NANL, 0}, - {"powl", powl, &ONEL, &INFINITYL, &NANL, 0}, - {"powl", powl, &MONEL, &INFINITYL, &NANL, 0}, - {"powl", powl, &ONEL, &MINFL, &NANL, 0}, - {"powl", powl, &MONEL, &MINFL, &NANL, 0}, + {"powl", powl, &ONEL, &INFINITYL, &ONEL, 0}, + {"powl", powl, &MONEL, &INFINITYL, &ONEL, 0}, + {"powl", powl, &ONEL, &MINFL, &ONEL, 0}, + {"powl", powl, &MONEL, &MINFL, &ONEL, 0}, {"powl", powl, &MTWOL, &HALFL, &NANL, 0}, {"powl", powl, &ZEROL, &MTHREEL, &INFINITYL, 0}, {"powl", powl, &NEGZEROL, &MTHREEL, &MINFL, 0}, |