Functions
pow_constexpr_test.cc File Reference
#include "cetlib/pow.h"

Go to the source code of this file.

Functions

int main ()
 

Function Documentation

int main ( void  )

Definition at line 4 of file pow_constexpr_test.cc.

5 {
6  static_assert(cet::pow<2>(3) == 9);
7  static_assert(cet::pow<3>(2) == 8);
8  static_assert(cet::pow<2>(0.5) == 0.25);
9  static_assert(cet::pow<1>(0.0f) == 0.0);
10 
11  static_assert(cet::diff_of_squares(13, 12) == 25);
12  static_assert(cet::diff_of_squares(13u, 12u) == 25u);
13  static_assert(cet::diff_of_squares(13L, 12L) == 25L);
14  static_assert(cet::diff_of_squares(13., 12.) == 25.);
15 
16  static_assert(cet::sum_of_squares(13, 12) == 313);
17  static_assert(cet::sum_of_squares(13u, 12u) == 313u);
18  static_assert(cet::sum_of_squares(13L, 12L) == 313L);
19  static_assert(cet::sum_of_squares(13., 12.) == 313.);
20 }
constexpr T diff_of_squares(T x, T y)
Definition: pow.h:132
constexpr T sum_of_squares(T x, T y)
Definition: pow.h:139