/*
- * Copyright 2017 Facebook, Inc.
+ * Copyright 2017-present Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
EXPECT_EQ(-20ll, rounded);
}
}
+
+TEST_F(ConstexprMathTest, constexpr_pow) {
+ {
+ constexpr auto a = folly::constexpr_pow(uint64_t(0), 15);
+ EXPECT_EQ(0, a);
+ }
+ {
+ constexpr auto a = folly::constexpr_pow(uint64_t(15), 0);
+ EXPECT_EQ(1, a);
+ }
+ {
+ constexpr auto a = folly::constexpr_pow(uint64_t(2), 6);
+ EXPECT_EQ(64, a);
+ }
+}