From 5c8a741af076a80f712afb6f73c73dbd519ac303 Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Wed, 29 Jan 2025 09:56:17 -0500 Subject: [PATCH] Update GFloat16 pow test case --- autotest/cpp/testfloat16.cpp | 5 +++-- port/cpl_float.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/autotest/cpp/testfloat16.cpp b/autotest/cpp/testfloat16.cpp index 159c648cacfd..d982347554db 100644 --- a/autotest/cpp/testfloat16.cpp +++ b/autotest/cpp/testfloat16.cpp @@ -169,8 +169,9 @@ TEST(TestFloat16, math) EXPECT_EQ(pow(GFloat16(x), GFloat16(y)), GFloat16(pow(x, y))); using std::fabs; using std::isfinite; - GFloat16 r1 = pow(GFloat16(x), j); - GFloat16 r2 = GFloat16(pow(x, j)); + GFloat16 r1, r2; + r1 = pow(GFloat16(x), j); + r2 = GFloat16(pow(x, j)); if (!isfinite(r1)) { EXPECT_EQ(r1, r2); diff --git a/port/cpl_float.h b/port/cpl_float.h index 3a660adceae5..0560be2eb3ae 100644 --- a/port/cpl_float.h +++ b/port/cpl_float.h @@ -640,6 +640,6 @@ template <> struct numeric_limits } // namespace std #endif // !defined(__STDCPP_FLOAT16_T__) -#endif +#endif // #ifdef __cplusplus #endif // CPL_FLOAT_H_INCLUDED