* commit '9f82c7bd5269631e3bad35414821255a83227ddc': Add a regression test for two libm bugs we didn't have.
This commit is contained in:
commit
aec4f5b03e
@ -1295,3 +1295,18 @@ TEST(math, frexpf_public_bug_6697) {
|
|||||||
float fr = frexpf(14.1f, &exp);
|
float fr = frexpf(14.1f, &exp);
|
||||||
ASSERT_FLOAT_EQ(14.1f, scalbnf(fr, exp));
|
ASSERT_FLOAT_EQ(14.1f, scalbnf(fr, exp));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST(math, exp2_STRICT_ALIGN_OpenBSD_bug) {
|
||||||
|
// OpenBSD/x86's libm had a bug here, but it was already fixed in FreeBSD:
|
||||||
|
// http://svnweb.FreeBSD.org/base/head/lib/msun/src/math_private.h?revision=240827&view=markup
|
||||||
|
ASSERT_DOUBLE_EQ(5.0, exp2(log2(5)));
|
||||||
|
ASSERT_FLOAT_EQ(5.0f, exp2f(log2f(5)));
|
||||||
|
ASSERT_DOUBLE_EQ(5.0L, exp2l(log2l(5)));
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST(math, nextafterl_OpenBSD_bug) {
|
||||||
|
// OpenBSD/x86's libm had a bug here.
|
||||||
|
ASSERT_TRUE(nextafter(1.0, 0.0) - 1.0 < 0.0);
|
||||||
|
ASSERT_TRUE(nextafterf(1.0f, 0.0f) - 1.0f < 0.0f);
|
||||||
|
ASSERT_TRUE(nextafterl(1.0L, 0.0L) - 1.0L < 0.0L);
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user