From 36a9fc062fa61f5d468c5ee3ad9e7d199ef9c153 Mon Sep 17 00:00:00 2001 From: Igor Sugak Date: Thu, 5 Jan 2017 20:11:17 -0800 Subject: [PATCH] fix gcc-5 build Summary: Clang with libgcc-5 reported: ```lang=bash folly/experimental/test/BitsTest.cpp:249:16: error: use of undeclared identifier 'pow' auto value = pow(2, bits) * (negate ? -2.0 : 2.0) / 3.0; ^ ``` Add missing include statement, and elaborate with the namespace. Reviewed By: yfeldblum Differential Revision: D4385807 fbshipit-source-id: a847dd439cd4c9f28ea8f222aa4ab60876949d13 --- folly/experimental/test/BitsTest.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/folly/experimental/test/BitsTest.cpp b/folly/experimental/test/BitsTest.cpp index af703824..aeff9d35 100644 --- a/folly/experimental/test/BitsTest.cpp +++ b/folly/experimental/test/BitsTest.cpp @@ -14,6 +14,8 @@ * limitations under the License. */ +#include + #include #include @@ -246,7 +248,7 @@ T testValue(int bits) { if (std::is_signed::value) { --bits; } - auto value = pow(2, bits) * (negate ? -2.0 : 2.0) / 3.0; + auto value = std::pow(2, bits) * (negate ? -2.0 : 2.0) / 3.0; CHECK_GE(value, std::numeric_limits::min()); CHECK_LE(value, std::numeric_limits::max()); return static_cast(value); -- 2.34.1