Merge "Changed long double literal suffix from 'l' to 'L'."
This commit is contained in:
commit
9c9ef0db91
@ -104,7 +104,7 @@ TEST(math, fpclassify) {
|
||||
|
||||
ASSERT_EQ(FP_NORMAL, fpclassify(1.0f));
|
||||
ASSERT_EQ(FP_NORMAL, fpclassify(1.0));
|
||||
ASSERT_EQ(FP_NORMAL, fpclassify(1.0l));
|
||||
ASSERT_EQ(FP_NORMAL, fpclassify(1.0L));
|
||||
|
||||
ASSERT_EQ(FP_SUBNORMAL, fpclassify(float_subnormal()));
|
||||
ASSERT_EQ(FP_SUBNORMAL, fpclassify(double_subnormal()));
|
||||
@ -112,13 +112,13 @@ TEST(math, fpclassify) {
|
||||
|
||||
ASSERT_EQ(FP_ZERO, fpclassify(0.0f));
|
||||
ASSERT_EQ(FP_ZERO, fpclassify(0.0));
|
||||
ASSERT_EQ(FP_ZERO, fpclassify(0.0l));
|
||||
ASSERT_EQ(FP_ZERO, fpclassify(0.0L));
|
||||
}
|
||||
|
||||
TEST(math, isfinite) {
|
||||
ASSERT_TRUE(test_capture_isfinite(123.0f));
|
||||
ASSERT_TRUE(test_capture_isfinite(123.0));
|
||||
ASSERT_TRUE(test_capture_isfinite(123.0l));
|
||||
ASSERT_TRUE(test_capture_isfinite(123.0L));
|
||||
ASSERT_FALSE(test_capture_isfinite(HUGE_VALF));
|
||||
ASSERT_FALSE(test_capture_isfinite(HUGE_VAL));
|
||||
ASSERT_FALSE(test_capture_isfinite(HUGE_VALL));
|
||||
@ -127,7 +127,7 @@ TEST(math, isfinite) {
|
||||
TEST(math, isinf) {
|
||||
ASSERT_FALSE(test_capture_isinf(123.0f));
|
||||
ASSERT_FALSE(test_capture_isinf(123.0));
|
||||
ASSERT_FALSE(test_capture_isinf(123.0l));
|
||||
ASSERT_FALSE(test_capture_isinf(123.0L));
|
||||
ASSERT_TRUE(test_capture_isinf(HUGE_VALF));
|
||||
ASSERT_TRUE(test_capture_isinf(HUGE_VAL));
|
||||
ASSERT_TRUE(test_capture_isinf(HUGE_VALL));
|
||||
@ -136,7 +136,7 @@ TEST(math, isinf) {
|
||||
TEST(math, isnan) {
|
||||
ASSERT_FALSE(test_capture_isnan(123.0f));
|
||||
ASSERT_FALSE(test_capture_isnan(123.0));
|
||||
ASSERT_FALSE(test_capture_isnan(123.0l));
|
||||
ASSERT_FALSE(test_capture_isnan(123.0L));
|
||||
ASSERT_TRUE(test_capture_isnan(nanf("")));
|
||||
ASSERT_TRUE(test_capture_isnan(nan("")));
|
||||
ASSERT_TRUE(test_capture_isnan(nanl("")));
|
||||
@ -145,7 +145,7 @@ TEST(math, isnan) {
|
||||
TEST(math, isnormal) {
|
||||
ASSERT_TRUE(isnormal(123.0f));
|
||||
ASSERT_TRUE(isnormal(123.0));
|
||||
ASSERT_TRUE(isnormal(123.0l));
|
||||
ASSERT_TRUE(isnormal(123.0L));
|
||||
ASSERT_FALSE(isnormal(float_subnormal()));
|
||||
ASSERT_FALSE(isnormal(double_subnormal()));
|
||||
ASSERT_FALSE(isnormal(ldouble_subnormal()));
|
||||
@ -155,15 +155,15 @@ TEST(math, isnormal) {
|
||||
TEST(math, signbit) {
|
||||
ASSERT_EQ(0, test_capture_signbit(0.0f));
|
||||
ASSERT_EQ(0, test_capture_signbit(0.0));
|
||||
ASSERT_EQ(0, test_capture_signbit(0.0l));
|
||||
ASSERT_EQ(0, test_capture_signbit(0.0L));
|
||||
|
||||
ASSERT_EQ(0, test_capture_signbit(1.0f));
|
||||
ASSERT_EQ(0, test_capture_signbit(1.0));
|
||||
ASSERT_EQ(0, test_capture_signbit(1.0l));
|
||||
ASSERT_EQ(0, test_capture_signbit(1.0L));
|
||||
|
||||
ASSERT_NE(0, test_capture_signbit(-1.0f));
|
||||
ASSERT_NE(0, test_capture_signbit(-1.0));
|
||||
ASSERT_NE(0, test_capture_signbit(-1.0l));
|
||||
ASSERT_NE(0, test_capture_signbit(-1.0L));
|
||||
}
|
||||
|
||||
TEST(math, __fpclassifyd) {
|
||||
@ -194,9 +194,9 @@ TEST(math, __fpclassifyl) {
|
||||
#if defined(__BIONIC__)
|
||||
EXPECT_EQ(FP_INFINITE, __fpclassifyl(HUGE_VALL));
|
||||
EXPECT_EQ(FP_NAN, __fpclassifyl(nanl("")));
|
||||
EXPECT_EQ(FP_NORMAL, __fpclassifyl(1.0l));
|
||||
EXPECT_EQ(FP_NORMAL, __fpclassifyl(1.0L));
|
||||
EXPECT_EQ(FP_SUBNORMAL, __fpclassifyl(ldouble_subnormal()));
|
||||
EXPECT_EQ(FP_ZERO, __fpclassifyl(0.0l));
|
||||
EXPECT_EQ(FP_ZERO, __fpclassifyl(0.0L));
|
||||
#else // __BIONIC__
|
||||
GTEST_LOG_(INFO) << "This test does nothing.\n";
|
||||
#endif // __BIONIC__
|
||||
@ -227,7 +227,7 @@ TEST(math, __isfinitef) {
|
||||
|
||||
TEST(math, __isfinitel) {
|
||||
#if defined(__BIONIC__)
|
||||
ASSERT_TRUE(__isfinitel(123.0l));
|
||||
ASSERT_TRUE(__isfinitel(123.0L));
|
||||
ASSERT_FALSE(__isfinitel(HUGE_VALL));
|
||||
#else // __BIONIC__
|
||||
GTEST_LOG_(INFO) << "This test does nothing.\n";
|
||||
@ -245,7 +245,7 @@ TEST(math, __isinff) {
|
||||
}
|
||||
|
||||
TEST(math, __isinfl) {
|
||||
ASSERT_FALSE(__isinfl(123.0l));
|
||||
ASSERT_FALSE(__isinfl(123.0L));
|
||||
ASSERT_TRUE(__isinfl(HUGE_VALL));
|
||||
}
|
||||
|
||||
@ -255,7 +255,7 @@ TEST(math, __isnanf) {
|
||||
}
|
||||
|
||||
TEST(math, __isnanl) {
|
||||
ASSERT_FALSE(__isnanl(123.0l));
|
||||
ASSERT_FALSE(__isnanl(123.0L));
|
||||
ASSERT_TRUE(__isnanl(nanl("")));
|
||||
}
|
||||
|
||||
@ -284,7 +284,7 @@ TEST(math, __isnormalf) {
|
||||
|
||||
TEST(math, __isnormall) {
|
||||
#if defined(__BIONIC__)
|
||||
ASSERT_TRUE(__isnormall(123.0l));
|
||||
ASSERT_TRUE(__isnormall(123.0L));
|
||||
ASSERT_FALSE(__isnormall(ldouble_subnormal()));
|
||||
#else // __BIONIC__
|
||||
GTEST_LOG_(INFO) << "This test does nothing.\n";
|
||||
@ -304,9 +304,9 @@ TEST(math, __signbitf) {
|
||||
}
|
||||
|
||||
TEST(math, __signbitl) {
|
||||
ASSERT_EQ(0l, __signbitl(0.0l));
|
||||
ASSERT_EQ(0l, __signbitl(1.0l));
|
||||
ASSERT_NE(0l, __signbitl(-1.0l));
|
||||
ASSERT_EQ(0L, __signbitl(0.0L));
|
||||
ASSERT_EQ(0L, __signbitl(1.0L));
|
||||
ASSERT_NE(0L, __signbitl(-1.0L));
|
||||
}
|
||||
|
||||
TEST(math, acos) {
|
||||
@ -318,7 +318,7 @@ TEST(math, acosf) {
|
||||
}
|
||||
|
||||
TEST(math, acosl) {
|
||||
ASSERT_DOUBLE_EQ(M_PI/2.0l, acosl(0.0l));
|
||||
ASSERT_DOUBLE_EQ(M_PI/2.0L, acosl(0.0L));
|
||||
}
|
||||
|
||||
TEST(math, asin) {
|
||||
@ -330,7 +330,7 @@ TEST(math, asinf) {
|
||||
}
|
||||
|
||||
TEST(math, asinl) {
|
||||
ASSERT_DOUBLE_EQ(0.0l, asinl(0.0l));
|
||||
ASSERT_DOUBLE_EQ(0.0L, asinl(0.0L));
|
||||
}
|
||||
|
||||
TEST(math, atan) {
|
||||
@ -342,7 +342,7 @@ TEST(math, atanf) {
|
||||
}
|
||||
|
||||
TEST(math, atanl) {
|
||||
ASSERT_DOUBLE_EQ(0.0l, atanl(0.0l));
|
||||
ASSERT_DOUBLE_EQ(0.0L, atanl(0.0L));
|
||||
}
|
||||
|
||||
TEST(math, atan2) {
|
||||
@ -354,7 +354,7 @@ TEST(math, atan2f) {
|
||||
}
|
||||
|
||||
TEST(math, atan2l) {
|
||||
ASSERT_DOUBLE_EQ(0.0l, atan2l(0.0l, 0.0l));
|
||||
ASSERT_DOUBLE_EQ(0.0L, atan2l(0.0L, 0.0L));
|
||||
}
|
||||
|
||||
TEST(math, cos) {
|
||||
@ -366,11 +366,11 @@ TEST(math, cosf) {
|
||||
}
|
||||
|
||||
TEST(math, cosl) {
|
||||
ASSERT_DOUBLE_EQ(1.0l, cosl(0.0l));
|
||||
ASSERT_DOUBLE_EQ(1.0L, cosl(0.0L));
|
||||
}
|
||||
|
||||
TEST(math, sin) {
|
||||
ASSERT_FLOAT_EQ(0.0, sin(0.0));
|
||||
ASSERT_DOUBLE_EQ(0.0, sin(0.0));
|
||||
}
|
||||
|
||||
TEST(math, sinf) {
|
||||
@ -378,7 +378,7 @@ TEST(math, sinf) {
|
||||
}
|
||||
|
||||
TEST(math, sinl) {
|
||||
ASSERT_DOUBLE_EQ(0.0l, sinl(0.0l));
|
||||
ASSERT_DOUBLE_EQ(0.0L, sinl(0.0L));
|
||||
}
|
||||
|
||||
TEST(math, tan) {
|
||||
@ -390,7 +390,7 @@ TEST(math, tanf) {
|
||||
}
|
||||
|
||||
TEST(math, tanl) {
|
||||
ASSERT_DOUBLE_EQ(0.0l, tanl(0.0l));
|
||||
ASSERT_DOUBLE_EQ(0.0L, tanl(0.0L));
|
||||
}
|
||||
|
||||
TEST(math, acosh) {
|
||||
@ -402,7 +402,7 @@ TEST(math, acoshf) {
|
||||
}
|
||||
|
||||
TEST(math, acoshl) {
|
||||
ASSERT_DOUBLE_EQ(0.0l, acoshl(1.0l));
|
||||
ASSERT_DOUBLE_EQ(0.0L, acoshl(1.0L));
|
||||
}
|
||||
|
||||
TEST(math, asinh) {
|
||||
@ -414,7 +414,7 @@ TEST(math, asinhf) {
|
||||
}
|
||||
|
||||
TEST(math, asinhl) {
|
||||
ASSERT_DOUBLE_EQ(0.0l, asinhl(0.0l));
|
||||
ASSERT_DOUBLE_EQ(0.0L, asinhl(0.0L));
|
||||
}
|
||||
|
||||
TEST(math, atanh) {
|
||||
@ -426,7 +426,7 @@ TEST(math, atanhf) {
|
||||
}
|
||||
|
||||
TEST(math, atanhl) {
|
||||
ASSERT_DOUBLE_EQ(0.0l, atanhl(0.0l));
|
||||
ASSERT_DOUBLE_EQ(0.0L, atanhl(0.0L));
|
||||
}
|
||||
|
||||
TEST(math, cosh) {
|
||||
@ -438,7 +438,7 @@ TEST(math, coshf) {
|
||||
}
|
||||
|
||||
TEST(math, coshl) {
|
||||
ASSERT_DOUBLE_EQ(1.0l, coshl(0.0l));
|
||||
ASSERT_DOUBLE_EQ(1.0L, coshl(0.0L));
|
||||
}
|
||||
|
||||
TEST(math, sinh) {
|
||||
@ -450,7 +450,7 @@ TEST(math, sinhf) {
|
||||
}
|
||||
|
||||
TEST(math, sinhl) {
|
||||
ASSERT_DOUBLE_EQ(0.0l, sinhl(0.0l));
|
||||
ASSERT_DOUBLE_EQ(0.0L, sinhl(0.0L));
|
||||
}
|
||||
|
||||
TEST(math, tanh) {
|
||||
@ -462,7 +462,7 @@ TEST(math, tanhf) {
|
||||
}
|
||||
|
||||
TEST(math, tanhl) {
|
||||
ASSERT_DOUBLE_EQ(0.0l, tanhl(0.0l));
|
||||
ASSERT_DOUBLE_EQ(0.0L, tanhl(0.0L));
|
||||
}
|
||||
|
||||
TEST(math, log) {
|
||||
@ -474,7 +474,7 @@ TEST(math, logf) {
|
||||
}
|
||||
|
||||
TEST(math, logl) {
|
||||
ASSERT_DOUBLE_EQ(1.0l, logl(M_E));
|
||||
ASSERT_DOUBLE_EQ(1.0L, logl(M_E));
|
||||
}
|
||||
|
||||
TEST(math, log2) {
|
||||
@ -486,7 +486,7 @@ TEST(math, log2f) {
|
||||
}
|
||||
|
||||
TEST(math, log2l) {
|
||||
ASSERT_DOUBLE_EQ(12.0l, log2l(4096.0l));
|
||||
ASSERT_DOUBLE_EQ(12.0L, log2l(4096.0L));
|
||||
}
|
||||
|
||||
TEST(math, log10) {
|
||||
@ -498,7 +498,7 @@ TEST(math, log10f) {
|
||||
}
|
||||
|
||||
TEST(math, log10l) {
|
||||
ASSERT_DOUBLE_EQ(3.0l, log10l(1000.0l));
|
||||
ASSERT_DOUBLE_EQ(3.0L, log10l(1000.0L));
|
||||
}
|
||||
|
||||
TEST(math, cbrt) {
|
||||
@ -510,7 +510,7 @@ TEST(math, cbrtf) {
|
||||
}
|
||||
|
||||
TEST(math, cbrtl) {
|
||||
ASSERT_DOUBLE_EQ(3.0l, cbrtl(27.0l));
|
||||
ASSERT_DOUBLE_EQ(3.0L, cbrtl(27.0L));
|
||||
}
|
||||
|
||||
TEST(math, sqrt) {
|
||||
@ -522,7 +522,7 @@ TEST(math, sqrtf) {
|
||||
}
|
||||
|
||||
TEST(math, sqrtl) {
|
||||
ASSERT_DOUBLE_EQ(2.0l, sqrtl(4.0l));
|
||||
ASSERT_DOUBLE_EQ(2.0L, sqrtl(4.0L));
|
||||
}
|
||||
|
||||
TEST(math, exp) {
|
||||
@ -536,8 +536,8 @@ TEST(math, expf) {
|
||||
}
|
||||
|
||||
TEST(math, expl) {
|
||||
ASSERT_DOUBLE_EQ(1.0l, expl(0.0l));
|
||||
ASSERT_DOUBLE_EQ(M_E, expl(1.0l));
|
||||
ASSERT_DOUBLE_EQ(1.0L, expl(0.0L));
|
||||
ASSERT_DOUBLE_EQ(M_E, expl(1.0L));
|
||||
}
|
||||
|
||||
TEST(math, exp2) {
|
||||
@ -549,7 +549,7 @@ TEST(math, exp2f) {
|
||||
}
|
||||
|
||||
TEST(math, exp2l) {
|
||||
ASSERT_DOUBLE_EQ(8.0l, exp2l(3.0l));
|
||||
ASSERT_DOUBLE_EQ(8.0L, exp2l(3.0L));
|
||||
}
|
||||
|
||||
TEST(math, expm1) {
|
||||
@ -561,7 +561,7 @@ TEST(math, expm1f) {
|
||||
}
|
||||
|
||||
TEST(math, expm1l) {
|
||||
ASSERT_DOUBLE_EQ(M_E - 1.0l, expm1l(1.0l));
|
||||
ASSERT_DOUBLE_EQ(M_E - 1.0L, expm1l(1.0L));
|
||||
}
|
||||
|
||||
TEST(math, pow) {
|
||||
@ -579,10 +579,10 @@ TEST(math, powf) {
|
||||
}
|
||||
|
||||
TEST(math, powl) {
|
||||
ASSERT_TRUE(__isnanl(powl(nanl(""), 3.0l)));
|
||||
ASSERT_DOUBLE_EQ(1.0l, (powl(1.0l, nanl(""))));
|
||||
ASSERT_TRUE(__isnanl(powl(2.0l, nanl(""))));
|
||||
ASSERT_DOUBLE_EQ(8.0l, powl(2.0l, 3.0l));
|
||||
ASSERT_TRUE(__isnanl(powl(nanl(""), 3.0L)));
|
||||
ASSERT_DOUBLE_EQ(1.0L, (powl(1.0L, nanl(""))));
|
||||
ASSERT_TRUE(__isnanl(powl(2.0L, nanl(""))));
|
||||
ASSERT_DOUBLE_EQ(8.0L, powl(2.0L, 3.0L));
|
||||
}
|
||||
|
||||
TEST(math, ceil) {
|
||||
@ -594,7 +594,7 @@ TEST(math, ceilf) {
|
||||
}
|
||||
|
||||
TEST(math, ceill) {
|
||||
ASSERT_DOUBLE_EQ(1.0, ceill(0.9l));
|
||||
ASSERT_DOUBLE_EQ(1.0L, ceill(0.9L));
|
||||
}
|
||||
|
||||
TEST(math, floor) {
|
||||
@ -606,7 +606,7 @@ TEST(math, floorf) {
|
||||
}
|
||||
|
||||
TEST(math, floorl) {
|
||||
ASSERT_DOUBLE_EQ(1.0l, floorl(1.1l));
|
||||
ASSERT_DOUBLE_EQ(1.0L, floorl(1.1L));
|
||||
}
|
||||
|
||||
TEST(math, fabs) {
|
||||
@ -618,7 +618,7 @@ TEST(math, fabsf) {
|
||||
}
|
||||
|
||||
TEST(math, fabsl) {
|
||||
ASSERT_DOUBLE_EQ(1.0l, fabsl(-1.0l));
|
||||
ASSERT_DOUBLE_EQ(1.0L, fabsl(-1.0L));
|
||||
}
|
||||
|
||||
TEST(math, ldexp) {
|
||||
@ -630,7 +630,7 @@ TEST(math, ldexpf) {
|
||||
}
|
||||
|
||||
TEST(math, ldexpl) {
|
||||
ASSERT_DOUBLE_EQ(16.0l, ldexpl(2.0l, 3.0));
|
||||
ASSERT_DOUBLE_EQ(16.0L, ldexpl(2.0L, 3.0));
|
||||
}
|
||||
|
||||
TEST(math, fmod) {
|
||||
@ -642,7 +642,7 @@ TEST(math, fmodf) {
|
||||
}
|
||||
|
||||
TEST(math, fmodl) {
|
||||
ASSERT_DOUBLE_EQ(2.0l, fmodl(12.0l, 10.0l));
|
||||
ASSERT_DOUBLE_EQ(2.0L, fmodl(12.0L, 10.0L));
|
||||
}
|
||||
|
||||
TEST(math, remainder) {
|
||||
@ -654,7 +654,7 @@ TEST(math, remainderf) {
|
||||
}
|
||||
|
||||
TEST(math, remainderl) {
|
||||
ASSERT_DOUBLE_EQ(2.0l, remainderl(12.0l, 10.0l));
|
||||
ASSERT_DOUBLE_EQ(2.0L, remainderl(12.0L, 10.0L));
|
||||
}
|
||||
|
||||
TEST(math, drem) {
|
||||
@ -678,9 +678,9 @@ TEST(math, fmaxf) {
|
||||
}
|
||||
|
||||
TEST(math, fmaxl) {
|
||||
ASSERT_DOUBLE_EQ(12.0l, fmaxl(12.0l, 10.0l));
|
||||
ASSERT_DOUBLE_EQ(12.0l, fmaxl(12.0l, nanl("")));
|
||||
ASSERT_DOUBLE_EQ(12.0l, fmaxl(nanl(""), 12.0l));
|
||||
ASSERT_DOUBLE_EQ(12.0L, fmaxl(12.0L, 10.0L));
|
||||
ASSERT_DOUBLE_EQ(12.0L, fmaxl(12.0L, nanl("")));
|
||||
ASSERT_DOUBLE_EQ(12.0L, fmaxl(nanl(""), 12.0L));
|
||||
}
|
||||
|
||||
TEST(math, fmin) {
|
||||
@ -696,9 +696,9 @@ TEST(math, fminf) {
|
||||
}
|
||||
|
||||
TEST(math, fminl) {
|
||||
ASSERT_DOUBLE_EQ(10.0l, fminl(12.0l, 10.0l));
|
||||
ASSERT_DOUBLE_EQ(12.0l, fminl(12.0l, nanl("")));
|
||||
ASSERT_DOUBLE_EQ(12.0l, fminl(nanl(""), 12.0l));
|
||||
ASSERT_DOUBLE_EQ(10.0L, fminl(12.0L, 10.0L));
|
||||
ASSERT_DOUBLE_EQ(12.0L, fminl(12.0L, nanl("")));
|
||||
ASSERT_DOUBLE_EQ(12.0L, fminl(nanl(""), 12.0L));
|
||||
}
|
||||
|
||||
TEST(math, fma) {
|
||||
@ -710,7 +710,7 @@ TEST(math, fmaf) {
|
||||
}
|
||||
|
||||
TEST(math, fmal) {
|
||||
ASSERT_DOUBLE_EQ(10.0l, fmal(2.0l, 3.0l, 4.0l));
|
||||
ASSERT_DOUBLE_EQ(10.0L, fmal(2.0L, 3.0L, 4.0L));
|
||||
}
|
||||
|
||||
TEST(math, hypot) {
|
||||
@ -722,7 +722,7 @@ TEST(math, hypotf) {
|
||||
}
|
||||
|
||||
TEST(math, hypotl) {
|
||||
ASSERT_DOUBLE_EQ(5.0l, hypotl(3.0l, 4.0l));
|
||||
ASSERT_DOUBLE_EQ(5.0L, hypotl(3.0L, 4.0L));
|
||||
}
|
||||
|
||||
TEST(math, erf) {
|
||||
@ -734,7 +734,7 @@ TEST(math, erff) {
|
||||
}
|
||||
|
||||
TEST(math, erfl) {
|
||||
ASSERT_DOUBLE_EQ(0.84270079294971489l, erfl(1.0l));
|
||||
ASSERT_DOUBLE_EQ(0.84270079294971489L, erfl(1.0L));
|
||||
}
|
||||
|
||||
TEST(math, erfc) {
|
||||
@ -746,27 +746,27 @@ TEST(math, erfcf) {
|
||||
}
|
||||
|
||||
TEST(math, erfcl) {
|
||||
ASSERT_DOUBLE_EQ(0.15729920705028513l, erfcl(1.0l));
|
||||
ASSERT_DOUBLE_EQ(0.15729920705028513l, erfcl(1.0L));
|
||||
}
|
||||
|
||||
TEST(math, lrint) {
|
||||
fesetround(FE_UPWARD); // lrint/lrintf/lrintl obey the rounding mode.
|
||||
ASSERT_EQ(1235, lrint(1234.01));
|
||||
ASSERT_EQ(1235, lrintf(1234.01f));
|
||||
ASSERT_EQ(1235, lrintl(1234.01l));
|
||||
ASSERT_EQ(1235, lrintl(1234.01L));
|
||||
fesetround(FE_TOWARDZERO); // lrint/lrintf/lrintl obey the rounding mode.
|
||||
ASSERT_EQ(1234, lrint(1234.01));
|
||||
ASSERT_EQ(1234, lrintf(1234.01f));
|
||||
ASSERT_EQ(1234, lrintl(1234.01l));
|
||||
ASSERT_EQ(1234, lrintl(1234.01L));
|
||||
|
||||
fesetround(FE_UPWARD); // llrint/llrintf/llrintl obey the rounding mode.
|
||||
ASSERT_EQ(1235L, llrint(1234.01));
|
||||
ASSERT_EQ(1235L, llrintf(1234.01f));
|
||||
ASSERT_EQ(1235L, llrintl(1234.01l));
|
||||
ASSERT_EQ(1235L, llrintl(1234.01L));
|
||||
fesetround(FE_TOWARDZERO); // llrint/llrintf/llrintl obey the rounding mode.
|
||||
ASSERT_EQ(1234L, llrint(1234.01));
|
||||
ASSERT_EQ(1234L, llrintf(1234.01f));
|
||||
ASSERT_EQ(1234L, llrintl(1234.01l));
|
||||
ASSERT_EQ(1234L, llrintl(1234.01L));
|
||||
}
|
||||
|
||||
TEST(math, rint) {
|
||||
@ -784,15 +784,15 @@ TEST(math, rint) {
|
||||
ASSERT_TRUE((fetestexcept(FE_ALL_EXCEPT) & FE_INEXACT) != 0);
|
||||
|
||||
feclearexcept(FE_ALL_EXCEPT); // rint/rintf/rintl do set the FE_INEXACT flag.
|
||||
ASSERT_EQ(1234.0, rintl(1234.0l));
|
||||
ASSERT_EQ(1234.0, rintl(1234.0L));
|
||||
ASSERT_TRUE((fetestexcept(FE_ALL_EXCEPT) & FE_INEXACT) == 0);
|
||||
ASSERT_EQ(1235.0, rintl(1234.01l));
|
||||
ASSERT_EQ(1235.0, rintl(1234.01L));
|
||||
ASSERT_TRUE((fetestexcept(FE_ALL_EXCEPT) & FE_INEXACT) != 0);
|
||||
|
||||
fesetround(FE_TOWARDZERO); // rint/rintf obey the rounding mode.
|
||||
ASSERT_EQ(1234.0, rint(1234.01));
|
||||
ASSERT_EQ(1234.0f, rintf(1234.01f));
|
||||
ASSERT_EQ(1234.0, rintl(1234.01l));
|
||||
ASSERT_EQ(1234.0, rintl(1234.01L));
|
||||
}
|
||||
|
||||
TEST(math, nearbyint) {
|
||||
@ -810,29 +810,29 @@ TEST(math, nearbyint) {
|
||||
ASSERT_TRUE((fetestexcept(FE_ALL_EXCEPT) & FE_INEXACT) == 0);
|
||||
|
||||
feclearexcept(FE_ALL_EXCEPT); // nearbyint/nearbyintf/nearbyintl don't set the FE_INEXACT flag.
|
||||
ASSERT_EQ(1234.0, nearbyintl(1234.0l));
|
||||
ASSERT_EQ(1234.0, nearbyintl(1234.0L));
|
||||
ASSERT_TRUE((fetestexcept(FE_ALL_EXCEPT) & FE_INEXACT) == 0);
|
||||
ASSERT_EQ(1235.0, nearbyintl(1234.01l));
|
||||
ASSERT_EQ(1235.0, nearbyintl(1234.01L));
|
||||
ASSERT_TRUE((fetestexcept(FE_ALL_EXCEPT) & FE_INEXACT) == 0);
|
||||
|
||||
fesetround(FE_TOWARDZERO); // nearbyint/nearbyintf/nearbyintl obey the rounding mode.
|
||||
ASSERT_EQ(1234.0, nearbyint(1234.01));
|
||||
ASSERT_EQ(1234.0f, nearbyintf(1234.01f));
|
||||
ASSERT_EQ(1234.0, nearbyintl(1234.01l));
|
||||
ASSERT_EQ(1234.0, nearbyintl(1234.01L));
|
||||
}
|
||||
|
||||
TEST(math, lround) {
|
||||
fesetround(FE_UPWARD); // lround ignores the rounding mode.
|
||||
ASSERT_EQ(1234, lround(1234.01));
|
||||
ASSERT_EQ(1234, lroundf(1234.01f));
|
||||
ASSERT_EQ(1234, lroundl(1234.01l));
|
||||
ASSERT_EQ(1234, lroundl(1234.01L));
|
||||
}
|
||||
|
||||
TEST(math, llround) {
|
||||
fesetround(FE_UPWARD); // llround ignores the rounding mode.
|
||||
ASSERT_EQ(1234L, llround(1234.01));
|
||||
ASSERT_EQ(1234L, llroundf(1234.01f));
|
||||
ASSERT_EQ(1234L, llroundl(1234.01l));
|
||||
ASSERT_EQ(1234L, llroundl(1234.01L));
|
||||
}
|
||||
|
||||
TEST(math, ilogb) {
|
||||
@ -852,11 +852,11 @@ TEST(math, ilogbf) {
|
||||
}
|
||||
|
||||
TEST(math, ilogbl) {
|
||||
ASSERT_EQ(FP_ILOGB0, ilogbl(0.0l));
|
||||
ASSERT_EQ(FP_ILOGB0, ilogbl(0.0L));
|
||||
ASSERT_EQ(FP_ILOGBNAN, ilogbl(nanl("")));
|
||||
ASSERT_EQ(INT_MAX, ilogbl(HUGE_VALL));
|
||||
ASSERT_EQ(0l, ilogbl(1.0l));
|
||||
ASSERT_EQ(3l, ilogbl(10.0l));
|
||||
ASSERT_EQ(0L, ilogbl(1.0L));
|
||||
ASSERT_EQ(3L, ilogbl(10.0L));
|
||||
}
|
||||
|
||||
TEST(math, logb) {
|
||||
@ -876,11 +876,11 @@ TEST(math, logbf) {
|
||||
}
|
||||
|
||||
TEST(math, logbl) {
|
||||
ASSERT_EQ(-HUGE_VAL, logbl(0.0l));
|
||||
ASSERT_EQ(-HUGE_VAL, logbl(0.0L));
|
||||
ASSERT_TRUE(isnan(logbl(nanl(""))));
|
||||
ASSERT_TRUE(isinf(logbl(HUGE_VALL)));
|
||||
ASSERT_EQ(0.0l, logbl(1.0l));
|
||||
ASSERT_EQ(3.0l, logbl(10.0l));
|
||||
ASSERT_EQ(0.0L, logbl(1.0L));
|
||||
ASSERT_EQ(3.0L, logbl(10.0L));
|
||||
}
|
||||
|
||||
TEST(math, log1p) {
|
||||
@ -898,10 +898,10 @@ TEST(math, log1pf) {
|
||||
}
|
||||
|
||||
TEST(math, log1pl) {
|
||||
ASSERT_EQ(-HUGE_VALL, log1pl(-1.0l));
|
||||
ASSERT_EQ(-HUGE_VALL, log1pl(-1.0L));
|
||||
ASSERT_TRUE(isnan(log1pl(nanl(""))));
|
||||
ASSERT_TRUE(isinf(log1pl(HUGE_VALL)));
|
||||
ASSERT_DOUBLE_EQ(1.0l, log1pl(M_E - 1.0l));
|
||||
ASSERT_DOUBLE_EQ(1.0L, log1pl(M_E - 1.0L));
|
||||
}
|
||||
|
||||
TEST(math, fdim) {
|
||||
@ -917,9 +917,9 @@ TEST(math, fdimf) {
|
||||
}
|
||||
|
||||
TEST(math, fdiml) {
|
||||
ASSERT_DOUBLE_EQ(0.0l, fdiml(1.0l, 1.0l));
|
||||
ASSERT_DOUBLE_EQ(1.0l, fdiml(2.0l, 1.0l));
|
||||
ASSERT_DOUBLE_EQ(0.0l, fdiml(1.0l, 2.0l));
|
||||
ASSERT_DOUBLE_EQ(0.0L, fdiml(1.0L, 1.0L));
|
||||
ASSERT_DOUBLE_EQ(1.0L, fdiml(2.0L, 1.0L));
|
||||
ASSERT_DOUBLE_EQ(0.0L, fdiml(1.0L, 2.0L));
|
||||
}
|
||||
|
||||
TEST(math, round) {
|
||||
@ -944,10 +944,10 @@ TEST(math, roundf) {
|
||||
|
||||
TEST(math, roundl) {
|
||||
fesetround(FE_TOWARDZERO); // roundl ignores the rounding mode and always rounds away from zero.
|
||||
ASSERT_DOUBLE_EQ(1.0l, roundl(0.5l));
|
||||
ASSERT_DOUBLE_EQ(-1.0l, roundl(-0.5l));
|
||||
ASSERT_DOUBLE_EQ(0.0l, roundl(0.0l));
|
||||
ASSERT_DOUBLE_EQ(-0.0l, roundl(-0.0l));
|
||||
ASSERT_DOUBLE_EQ(1.0L, roundl(0.5L));
|
||||
ASSERT_DOUBLE_EQ(-1.0L, roundl(-0.5L));
|
||||
ASSERT_DOUBLE_EQ(0.0L, roundl(0.0L));
|
||||
ASSERT_DOUBLE_EQ(-0.0L, roundl(-0.0L));
|
||||
ASSERT_TRUE(isnan(roundl(nanl(""))));
|
||||
ASSERT_DOUBLE_EQ(HUGE_VALL, roundl(HUGE_VALL));
|
||||
}
|
||||
@ -974,10 +974,10 @@ TEST(math, truncf) {
|
||||
|
||||
TEST(math, truncl) {
|
||||
fesetround(FE_UPWARD); // truncl ignores the rounding mode and always rounds toward zero.
|
||||
ASSERT_DOUBLE_EQ(1.0l, truncl(1.5l));
|
||||
ASSERT_DOUBLE_EQ(-1.0l, truncl(-1.5l));
|
||||
ASSERT_DOUBLE_EQ(0.0l, truncl(0.0l));
|
||||
ASSERT_DOUBLE_EQ(-0.0l, truncl(-0.0l));
|
||||
ASSERT_DOUBLE_EQ(1.0L, truncl(1.5L));
|
||||
ASSERT_DOUBLE_EQ(-1.0L, truncl(-1.5L));
|
||||
ASSERT_DOUBLE_EQ(0.0L, truncl(0.0L));
|
||||
ASSERT_DOUBLE_EQ(-0.0L, truncl(-0.0L));
|
||||
ASSERT_TRUE(isnan(truncl(nan(""))));
|
||||
ASSERT_DOUBLE_EQ(HUGE_VALL, truncl(HUGE_VALL));
|
||||
}
|
||||
@ -995,12 +995,12 @@ TEST(math, nextafterf) {
|
||||
}
|
||||
|
||||
TEST(math, nextafterl) {
|
||||
ASSERT_DOUBLE_EQ(0.0l, nextafterl(0.0l, 0.0l));
|
||||
ASSERT_DOUBLE_EQ(0.0L, nextafterl(0.0L, 0.0L));
|
||||
// Use a runtime value to accomodate the case when
|
||||
// sizeof(double) == sizeof(long double)
|
||||
long double smallest_positive = ldexpl(1.0l, LDBL_MIN_EXP - LDBL_MANT_DIG);
|
||||
ASSERT_DOUBLE_EQ(smallest_positive, nextafterl(0.0l, 1.0l));
|
||||
ASSERT_DOUBLE_EQ(0.0l, nextafterl(0.0l, -1.0l));
|
||||
long double smallest_positive = ldexpl(1.0L, LDBL_MIN_EXP - LDBL_MANT_DIG);
|
||||
ASSERT_DOUBLE_EQ(smallest_positive, nextafterl(0.0L, 1.0L));
|
||||
ASSERT_DOUBLE_EQ(0.0L, nextafterl(0.0L, -1.0L));
|
||||
}
|
||||
|
||||
// TODO: nexttoward
|
||||
@ -1022,10 +1022,10 @@ TEST(math, copysignf) {
|
||||
}
|
||||
|
||||
TEST(math, copysignl) {
|
||||
ASSERT_DOUBLE_EQ(0.0l, copysignl(0.0l, 1.0l));
|
||||
ASSERT_DOUBLE_EQ(-0.0l, copysignl(0.0l, -1.0l));
|
||||
ASSERT_DOUBLE_EQ(2.0l, copysignl(2.0l, 1.0l));
|
||||
ASSERT_DOUBLE_EQ(-2.0l, copysignl(2.0l, -1.0l));
|
||||
ASSERT_DOUBLE_EQ(0.0L, copysignl(0.0L, 1.0L));
|
||||
ASSERT_DOUBLE_EQ(-0.0L, copysignl(0.0L, -1.0L));
|
||||
ASSERT_DOUBLE_EQ(2.0L, copysignl(2.0L, 1.0L));
|
||||
ASSERT_DOUBLE_EQ(-2.0L, copysignl(2.0L, -1.0L));
|
||||
}
|
||||
|
||||
TEST(math, significand) {
|
||||
@ -1043,9 +1043,9 @@ TEST(math, significandf) {
|
||||
extern "C" long double significandl(long double); // BSD's <math.h> doesn't declare this.
|
||||
|
||||
TEST(math, significandl) {
|
||||
ASSERT_DOUBLE_EQ(0.0l, significandl(0.0l));
|
||||
ASSERT_DOUBLE_EQ(1.2l, significandl(1.2l));
|
||||
ASSERT_DOUBLE_EQ(1.5375l, significandl(12.3l));
|
||||
ASSERT_DOUBLE_EQ(0.0L, significandl(0.0L));
|
||||
ASSERT_DOUBLE_EQ(1.2L, significandl(1.2L));
|
||||
ASSERT_DOUBLE_EQ(1.5375L, significandl(12.3L));
|
||||
}
|
||||
|
||||
TEST(math, scalb) {
|
||||
@ -1065,7 +1065,7 @@ TEST(math, scalblnf) {
|
||||
}
|
||||
|
||||
TEST(math, scalblnl) {
|
||||
ASSERT_DOUBLE_EQ(12.0l, scalblnl(3.0l, 2L));
|
||||
ASSERT_DOUBLE_EQ(12.0L, scalblnl(3.0L, 2L));
|
||||
}
|
||||
|
||||
TEST(math, scalbn) {
|
||||
@ -1077,7 +1077,7 @@ TEST(math, scalbnf) {
|
||||
}
|
||||
|
||||
TEST(math, scalbnl) {
|
||||
ASSERT_DOUBLE_EQ(12.0l, scalbnl(3.0l, 2));
|
||||
ASSERT_DOUBLE_EQ(12.0L, scalbnl(3.0L, 2));
|
||||
}
|
||||
|
||||
TEST(math, gamma) {
|
||||
@ -1117,7 +1117,7 @@ TEST(math, lgammaf) {
|
||||
}
|
||||
|
||||
TEST(math, lgammal) {
|
||||
ASSERT_DOUBLE_EQ(logl(24.0l), lgammal(5.0l));
|
||||
ASSERT_DOUBLE_EQ(logl(24.0L), lgammal(5.0L));
|
||||
}
|
||||
|
||||
TEST(math, lgamma_r) {
|
||||
@ -1141,7 +1141,7 @@ TEST(math, tgammaf) {
|
||||
}
|
||||
|
||||
TEST(math, tgammal) {
|
||||
ASSERT_DOUBLE_EQ(24.0l, tgammal(5.0l));
|
||||
ASSERT_DOUBLE_EQ(24.0L, tgammal(5.0L));
|
||||
}
|
||||
|
||||
TEST(math, j0) {
|
||||
@ -1218,8 +1218,8 @@ TEST(math, frexpf) {
|
||||
|
||||
TEST(math, frexpl) {
|
||||
int exp;
|
||||
long double ldr = frexpl(1024.0l, &exp);
|
||||
ASSERT_DOUBLE_EQ(1024.0l, scalbnl(ldr, exp));
|
||||
long double ldr = frexpl(1024.0L, &exp);
|
||||
ASSERT_DOUBLE_EQ(1024.0L, scalbnl(ldr, exp));
|
||||
}
|
||||
|
||||
TEST(math, modf) {
|
||||
@ -1272,9 +1272,9 @@ TEST(math, remquof) {
|
||||
|
||||
TEST(math, remquol) {
|
||||
int q;
|
||||
long double ld = remquol(13.0l, 4.0l, &q);
|
||||
ASSERT_DOUBLE_EQ(3l, q);
|
||||
ASSERT_DOUBLE_EQ(1.0l, ld);
|
||||
long double ld = remquol(13.0L, 4.0L, &q);
|
||||
ASSERT_DOUBLE_EQ(3L, q);
|
||||
ASSERT_DOUBLE_EQ(1.0L, ld);
|
||||
}
|
||||
|
||||
// https://code.google.com/p/android/issues/detail?id=6697
|
||||
|
Loading…
Reference in New Issue
Block a user