1 /* Test iseqsig with excess precision.
2 Copyright (C) 2016-2023 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, see
17 <https://www.gnu.org/licenses/>. */
28 if (FLT_EVAL_METHOD
== 1 || FLT_EVAL_METHOD
== 2 || FLT_EVAL_METHOD
> 32)
30 /* Excess precision for float. */
31 if (iseqsig (1.0f
, 1.0f
+ (float) DBL_EPSILON
))
33 puts ("iseqsig removes excess precision float -> double");
37 puts ("iseqsig preserves excess precision float -> double");
38 if (iseqsig (__builtin_inff (), FLT_MAX
* FLT_MAX
))
40 puts ("iseqsig removes excess range float -> double");
44 puts ("iseqsig preserves excess range float -> double");
47 if (FLT_EVAL_METHOD
== 2 || FLT_EVAL_METHOD
> 64)
49 /* Excess precision for float and double. */
50 if (iseqsig (1.0f
, 1.0f
+ (float) LDBL_EPSILON
))
52 puts ("iseqsig removes excess precision float -> long double");
56 puts ("iseqsig preserves excess precision float -> long double");
57 if (iseqsig (1.0, 1.0 + (double) LDBL_EPSILON
))
59 puts ("iseqsig removes excess precision double -> long double");
63 puts ("iseqsig preserves excess precision double -> long double");
64 if (LDBL_MAX_EXP
>= 2 * DBL_MAX_EXP
)
66 if (iseqsig (__builtin_inf (), DBL_MAX
* DBL_MAX
))
68 puts ("iseqsig removes excess range double -> long double");
72 puts ("iseqsig preserves excess range double -> long double");
79 #define TEST_FUNCTION do_test ()
80 #include "../test-skeleton.c"