Lines Matching +full:0 +full:- +full:987

1 /*-
38 #include "test-utils.h"
64 * Compare d1 and d2 using special rules: NaN == NaN and +0 != -0.
81 0, 8, 2, 2, in test_finite()
82 0, -8, 2, -2, in test_finite()
83 4, 0, 2, 0, in test_finite()
84 -4, 0, 0, 2, in test_finite()
86 3, -4, 2, -1, in test_finite()
87 -3, 4, 1, 2, in test_finite()
88 -3, -4, 1, -2, in test_finite()
97 987, 9916, 74, 67, in test_finite()
113 0x1.p30, in test_finite()
114 0x1.p-30, in test_finite()
121 for (i = 0; i < nitems(tests); i += 4) { in test_finite()
122 for (j = 0; j < nitems(mults); j++) { in test_finite()
134 * Test the handling of +/- 0.
141 assert_equal(t_csqrt(CMPLXL(-0.0, 0.0)), CMPLXL(0.0, 0.0)); in test_zeros()
142 assert_equal(t_csqrt(CMPLXL(0.0, -0.0)), CMPLXL(0.0, -0.0)); in test_zeros()
143 assert_equal(t_csqrt(CMPLXL(-0.0, -0.0)), CMPLXL(0.0, -0.0)); in test_zeros()
154 -0.0, in test_infinities()
156 -42.0, in test_infinities()
158 -INFINITY, in test_infinities()
163 for (i = 0; i < nitems(vals); i++) { in test_infinities()
165 assert_equal(t_csqrt(CMPLXL(-INFINITY, vals[i])), in test_infinities()
172 assert_equal(t_csqrt(CMPLXL(vals[i], -INFINITY)), in test_infinities()
173 CMPLXL(INFINITY, -INFINITY)); in test_infinities()
187 ATF_CHECK(isnan(creall(t_csqrt(CMPLXL(-INFINITY, NAN))))); in test_nans()
188 ATF_CHECK(isinf(cimagl(t_csqrt(CMPLXL(-INFINITY, NAN))))); in test_nans()
192 assert_equal(t_csqrt(CMPLXL(NAN, -INFINITY)), in test_nans()
193 CMPLXL(INFINITY, -INFINITY)); in test_nans()
196 assert_equal(t_csqrt(CMPLXL(-0.0, NAN)), CMPLXL(NAN, NAN)); in test_nans()
198 assert_equal(t_csqrt(CMPLXL(-42.0, NAN)), CMPLXL(NAN, NAN)); in test_nans()
200 assert_equal(t_csqrt(CMPLXL(NAN, -0.0)), CMPLXL(NAN, NAN)); in test_nans()
202 assert_equal(t_csqrt(CMPLXL(NAN, -42.0)), CMPLXL(NAN, NAN)); in test_nans()
218 ATF_CHECK(maxexp > 0 && maxexp % 2 == 0); in test_overflow()
220 for (i = 0; i < 4; i++) { in test_overflow()
221 exp = maxexp - 2 * i; in test_overflow()
224 a = ldexpl(115 * 0x1p-8, exp); in test_overflow()
225 b = ldexpl(252 * 0x1p-8, exp); in test_overflow()
227 ATF_CHECK_EQ(creall(result), ldexpl(14 * 0x1p-4, exp / 2)); in test_overflow()
228 ATF_CHECK_EQ(cimagl(result), ldexpl(9 * 0x1p-4, exp / 2)); in test_overflow()
230 /* csqrt(-11 + 60*I) = 5 + 6*I */ in test_overflow()
231 a = ldexpl(-11 * 0x1p-6, exp); in test_overflow()
232 b = ldexpl(60 * 0x1p-6, exp); in test_overflow()
234 ATF_CHECK_EQ(creall(result), ldexpl(5 * 0x1p-3, exp / 2)); in test_overflow()
235 ATF_CHECK_EQ(cimagl(result), ldexpl(6 * 0x1p-3, exp / 2)); in test_overflow()
237 /* csqrt(225 + 0*I) == 15 + 0*I */ in test_overflow()
238 a = ldexpl(225 * 0x1p-8, exp); in test_overflow()
239 b = 0; in test_overflow()
241 ATF_CHECK_EQ(creall(result), ldexpl(15 * 0x1p-4, exp / 2)); in test_overflow()
242 ATF_CHECK_EQ(cimagl(result), 0); in test_overflow()
267 ATF_REQUIRE(maxexp > 0 && maxexp % 2 == 0); in test_precision()
271 for (exp = 0; exp <= maxexp; exp += 2) { in test_precision()
272 mantbits = ((ldbl_mant_type)1 << (mantdig / 2)) - 1; in test_precision()
273 for (i = 0; i < 100 && in test_precision()
274 mantbits > ((ldbl_mant_type)1 << (mantdig / 2 - 1)); in test_precision()
275 i++, mantbits--) { in test_precision()
278 * sq_mantibts is a mantdig-bit number. Divide by in test_precision()
280 * note, the binary power will be -1. Raise it by in test_precision()
288 exp - 1 - mantdig); in test_precision()
289 x = ldexpl(mantbits, (exp - 2 - mantdig) / 2); in test_precision()
291 result = t_csqrt(CMPLXL(0, b)); in test_precision()
352 /* i386 is configured to use 53-bit rounding precision for long double. */ in ATF_TC_BODY()