[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)
- [lmi-commits] [lmi] master updated (0ec5f1b -> 9cc560d), Greg Chicares, 2021/03/08
- [lmi-commits] [lmi] master 88f799c 6/8: Avoid using gcc-specific warnings with clang, Greg Chicares, 2021/03/08
- [lmi-commits] [lmi] master d126046 5/8: Disable clang -Wbraced-scalar-init in a test, Greg Chicares, 2021/03/08
- [lmi-commits] [lmi] master 9cc560d 8/8: Fix defect introduced 20210303T1108Z: misalignment, Greg Chicares, 2021/03/08
- [lmi-commits] [lmi] master 71238a3 4/8: Disable clang tautological constant compare warning in a test, Greg Chicares, 2021/03/08
- [lmi-commits] [lmi] master 0dda3f5 2/8: Disable clang -Wself-assign-overloaded warning in date test, Greg Chicares, 2021/03/08
- [lmi-commits] [lmi] master fc767f7 3/8: Include <cmath> to get std::rint() declaration, not <math.h>,
Greg Chicares <=
- [lmi-commits] [lmi] master 33a1270 1/8: Remove tests involving std::mem_fun, Greg Chicares, 2021/03/08
- [lmi-commits] [lmi] master f5d41a0 7/8: Replace raw string literals, Greg Chicares, 2021/03/08