From patchwork Fri May 20 21:37:18 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Paul E. Murphy" X-Patchwork-Id: 12437 Received: (qmail 124378 invoked by alias); 20 May 2016 21:47:55 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 124342 invoked by uid 89); 20 May 2016 21:47:54 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL, BAYES_00, KAM_LAZY_DOMAIN_SECURITY, RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=test_f_i, ilogb_test_data, test_f_i_data, TEST_f_i X-HELO: e33.co.us.ibm.com X-IBM-Helo: d03dlp01.boulder.ibm.com X-IBM-MailFrom: murphyp@linux.vnet.ibm.com X-IBM-RcptTo: libc-alpha@sourceware.org From: "Paul E. Murphy" To: libc-alpha@sourceware.org Subject: [PATCHv2 09/14] Replace M_El with exp1 in libm-test.inc Date: Fri, 20 May 2016 16:37:18 -0500 Message-Id: In-Reply-To: References: In-Reply-To: References: X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16052021-0009-0000-0000-0000378D2705 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused This is useful in situations where the long double type is less precise than the type under test. * gen-libm-test.pl (beautify): Add beautifier for exp1 => e. * libm-test.inc: Replace usage of M_El with [exp1]: New macro. --- math/gen-libm-test.pl | 1 + math/libm-test.inc | 11 ++++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/math/gen-libm-test.pl b/math/gen-libm-test.pl index 17f17f7..c8790e1 100755 --- a/math/gen-libm-test.pl +++ b/math/gen-libm-test.pl @@ -59,6 +59,7 @@ use vars qw (%auto_tests); "minus_infty" => "-inf", "plus_infty" => "inf", "qnan_value" => "qNaN", + "exp1" => "e", ); diff --git a/math/libm-test.inc b/math/libm-test.inc index 5548a6c..6c85b40 100644 --- a/math/libm-test.inc +++ b/math/libm-test.inc @@ -331,6 +331,11 @@ struct ulp_data /* pi */ #define pi LIT (3.141592653589793238462643383279502884) +/* Other useful constants. */ + +/* e (expressed as exp1). */ +#define exp1 LIT(2.718281828459045235360287471352662498) + #define ulps_file_name "ULPs" /* Name of the ULPs file. */ static FILE *ulps_file; /* File to document difference. */ static int output_ulps; /* Should ulps printed? */ @@ -7087,7 +7092,7 @@ static const struct test_f_f_data fabs_test_data[] = TEST_f_f (fabs, -min_value, min_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), TEST_f_f (fabs, -max_value, max_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), TEST_f_f (fabs, 38.0, 38.0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), - TEST_f_f (fabs, -M_El, M_El, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), + TEST_f_f (fabs, -exp1, exp1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), }; static void @@ -7919,7 +7924,7 @@ hypot_test (void) static const struct test_f_i_data ilogb_test_data[] = { TEST_f_i (ilogb, 1, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), - TEST_f_i (ilogb, M_El, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), + TEST_f_i (ilogb, exp1, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), TEST_f_i (ilogb, 1024, 10, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), TEST_f_i (ilogb, -2000, 10, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), TEST_f_i (ilogb, 0.5, -1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED); @@ -9059,7 +9064,7 @@ static const struct test_f_f_data logb_test_data[] = TEST_f_f (logb, -qnan_value, qnan_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), TEST_f_f (logb, 1, 0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), - TEST_f_f (logb, M_El, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), + TEST_f_f (logb, exp1, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), TEST_f_f (logb, 1024, 10, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED), TEST_f_f (logb, -2000, 10, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),