[libc-commits] [libc] [libc][math] Fix subtraction of infinity (PR #152017)

via libc-commits libc-commits at lists.llvm.org
Mon Aug 4 12:30:09 PDT 2025


================
@@ -47,6 +47,8 @@ class SubTest : public LIBC_NAMESPACE::testing::FEnvSafeTest {
     EXPECT_FP_EQ(neg_inf, func(in.neg_inf, in.zero));
     EXPECT_FP_EQ(inf, func(in.inf, in.neg_zero));
     EXPECT_FP_EQ(neg_inf, func(in.neg_inf, in.neg_zero));
+    EXPECT_FP_EQ(neg_inf, func(in.zero, in.inf));
+    EXPECT_FP_EQ(inf, func(in.zero, in.neg_inf));
----------------
overmighty wrote:

Should probably add the equivalent tests in `AddTest.h` while we're at it.

https://github.com/llvm/llvm-project/pull/152017


More information about the libc-commits mailing list