[libcxx-commits] [libcxx] r360673 - [libc++] [test] Use std::nextafter() instead of std::nexttoward()

Michal Gorny via libcxx-commits libcxx-commits at lists.llvm.org
Tue May 14 06:56:20 PDT 2019


Author: mgorny
Date: Tue May 14 06:56:20 2019
New Revision: 360673

URL: http://llvm.org/viewvc/llvm-project?rev=360673&view=rev
Log:
[libc++] [test] Use std::nextafter() instead of std::nexttoward()

Use std::nextafter() instead of std::nexttoward() in midpoint tests.
In the context of this test, this should not cause any difference.
Since nexttowardl() is not implemented on NetBSD 8, the latter function
combined with 'long double' type caused test failure.  nextafterl() does
not have this problem.

Differential Revision: https://reviews.llvm.org/D61748

Modified:
    libcxx/trunk/test/std/numerics/numeric.ops/numeric.ops.midpoint/midpoint.float.pass.cpp

Modified: libcxx/trunk/test/std/numerics/numeric.ops/numeric.ops.midpoint/midpoint.float.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/numerics/numeric.ops/numeric.ops.midpoint/midpoint.float.pass.cpp?rev=360673&r1=360672&r2=360673&view=diff
==============================================================================
--- libcxx/trunk/test/std/numerics/numeric.ops/numeric.ops.midpoint/midpoint.float.pass.cpp (original)
+++ libcxx/trunk/test/std/numerics/numeric.ops/numeric.ops.midpoint/midpoint.float.pass.cpp Tue May 14 06:56:20 2019
@@ -76,8 +76,8 @@ void fp_test()
 
 //  Check two values "close to each other"
     T d1 = 3.14;
-    T d0 = std::nexttoward(d1, T(2));
-    T d2 = std::nexttoward(d1, T(5));
+    T d0 = std::nextafter(d1, T(2));
+    T d2 = std::nextafter(d1, T(5));
     assert(d0 < d1);  // sanity checking
     assert(d1 < d2);  // sanity checking
 




More information about the libcxx-commits mailing list