lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master fc767f7 3/8: Include <cmath> to get std::rint


From: Greg Chicares
Subject: [lmi-commits] [lmi] master fc767f7 3/8: Include <cmath> to get std::rint() declaration, not <math.h>
Date: Mon, 8 Mar 2021 11:19:46 -0500 (EST)

branch: master
commit fc767f76eb5df75ec405520a40a7223f8adea68e
Author: Vadim Zeitlin <vadim@tt-solutions.com>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>

    Include <cmath> to get std::rint() declaration, not <math.h>
    
    Code using std::rint() must include the header declaring it instead of
    <math.h> which may, but doesn't have to, include it indirectly.
    
    This fixes compilation of the test with clang which doesn't declare
    std::rint() in its <math.h>.
---
 fenv_lmi_test.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fenv_lmi_test.cpp b/fenv_lmi_test.cpp
index 3f27dc9..d02f991 100644
--- a/fenv_lmi_test.cpp
+++ b/fenv_lmi_test.cpp
@@ -42,7 +42,7 @@
 #include <bitset>
 #include <cfenv>
 #include <climits>                      // CHAR_BIT
-#include <math.h>                       // rint()
+#include <cmath>                        // rint()
 #include <stdexcept>
 
 std::bitset<CHAR_BIT * sizeof(std::uint32_t)> bits(std::uint32_t i)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]