This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Use M_PI_34l consistently in libm-test.inc


Two tests of carg use "3 * M_PI_4l" (or equivalent with -3), which
isn't necessarily an exact multiplication.  To avoid any issues with
lack of constant folding for IBM long double (as described in
<http://sourceware.org/ml/libc-alpha/2013-05/msg00221.html>), these
should use something that can be constant-folded instead, and since
libm-test.inc defines M_PI_34l, that may as well be used directly in
these tests, which this patch does.

Tested x86_64 and x86; no ulps changes needed.

2013-05-09  Joseph Myers  <joseph@codesourcery.com>

	* math/libm-test.inc (carg_test): Use M_PI_34l instead of 3 *
	M_PI_4l.

diff --git a/math/libm-test.inc b/math/libm-test.inc
index 6294f72..160f2a8 100644
--- a/math/libm-test.inc
+++ b/math/libm-test.inc
@@ -3031,9 +3031,9 @@ carg_test (void)
 
   TEST_c_f (carg, plus_infty, minus_infty, -M_PI_4l);
 
-  TEST_c_f (carg, minus_infty, plus_infty, 3 * M_PI_4l);
+  TEST_c_f (carg, minus_infty, plus_infty, M_PI_34l);
 
-  TEST_c_f (carg, minus_infty, minus_infty, -3 * M_PI_4l);
+  TEST_c_f (carg, minus_infty, minus_infty, -M_PI_34l);
 
   TEST_c_f (carg, qnan_value, qnan_value, qnan_value);
 

-- 
Joseph S. Myers
joseph@codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]