All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
constexpr_math_test.cc
Go to the documentation of this file.
2 
3 int main()
4 {
5  static_assert(util::abs(-0.0) == 0.0);
6  static_assert(util::abs(-2.0) == 2.0);
7  static_assert(util::abs(-2.0F) == 2.0F);
8  static_assert(util::abs(-2) == 2);
9  static_assert(util::abs(-2L) == 2L);
10  static_assert(util::abs(-2LL) == 2LL);
11 }
constexpr auto abs(T v)
Returns the absolute value of the argument.
Mathematical functions that C++ standard doesn't require constexpr.
int main(int argc, char **argv)