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

Michał Górny via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu May 9 12:06:43 PDT 2019


mgorny created this revision.
mgorny added reviewers: mclow.lists, EricWF, krytarowski.
Herald added a subscriber: christof.

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.


https://reviews.llvm.org/D61748

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


Index: libcxx/test/std/numerics/numeric.ops/numeric.ops.midpoint/midpoint.float.pass.cpp
===================================================================
--- libcxx/test/std/numerics/numeric.ops/numeric.ops.midpoint/midpoint.float.pass.cpp
+++ libcxx/test/std/numerics/numeric.ops/numeric.ops.midpoint/midpoint.float.pass.cpp
@@ -76,8 +76,8 @@
 
 //  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
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D61748.198881.patch
Type: text/x-patch
Size: 651 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20190509/a2a84633/attachment.bin>


More information about the libcxx-commits mailing list