libstdc++: testsuite: use cmath long double overloads
In case we need to supplement the C standard library with additional definitions for float and long double, the declarations expected to be in the C headers may not be there. Rely on the cmath overloads instead. for libstdc++-v3/ChangeLog * testsuite/20_util/to_chars/long_double.cc: Use cmath long double overloads for nexttoward and ldexp.
This commit is contained in:
parent
8fce31f69b
commit
01e094f82d
1 changed files with 3 additions and 3 deletions
|
@ -54,11 +54,11 @@ namespace detail
|
|||
{
|
||||
long double
|
||||
nextupl(long double x)
|
||||
{ return nexttowardl(x, numeric_limits<long double>::infinity()); }
|
||||
{ return nexttoward(x, numeric_limits<long double>::infinity()); }
|
||||
|
||||
long double
|
||||
nextdownl(long double x)
|
||||
{ return nexttowardl(x, -numeric_limits<long double>::infinity()); }
|
||||
{ return nexttoward(x, -numeric_limits<long double>::infinity()); }
|
||||
}
|
||||
|
||||
// The long double overloads of std::to_chars currently just go through printf
|
||||
|
@ -138,7 +138,7 @@ test01()
|
|||
for (int exponent : {-11000, -3000, -300, -50, -7, 0, 7, 50, 300, 3000, 11000})
|
||||
for (long double testcase : hex_testcases)
|
||||
{
|
||||
testcase = ldexpl(testcase, exponent);
|
||||
testcase = ldexp(testcase, exponent);
|
||||
if (testcase == 0.0L || isinf(testcase))
|
||||
continue;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue