OpenMPCD
MathematicalConstants.hpp
Go to the documentation of this file.
1 /**
2  * @file
3  * Defines mathematical constants.
4  */
5 
6 #ifndef OPENMPCD_UTILITY_MATHEMATICALCONSTANTS_HPP
7 #define OPENMPCD_UTILITY_MATHEMATICALCONSTANTS_HPP
8 
10 
11 namespace OpenMPCD
12 {
13 namespace Utility
14 {
15 
16 /**
17  * Holds mathematical constants.
18  */
19 namespace MathematicalConstants
20 {
21 
22 /**
23  * Returns the value of \f$ \pi \f$.
24  *
25  * @tparam T The data type to return.
26  */
27 template<typename T>
29 T pi()
30 {
31  return 3.14159265358979323846264338327950288419716939937510582097494459230L;
32 }
33 
34 } //namespace MathematicalConstants
35 } //namespace Utility
36 } //namespace OpenMPCD
37 
38 #endif //OPENMPCD_UTILITY_MATHEMATICALCONSTANTS_HPP
OPENMPCD_CUDA_HOST_AND_DEVICE
#define OPENMPCD_CUDA_HOST_AND_DEVICE
Denotes a function to be callable both from the Host and from a CUDA Device.
Definition: Macros.hpp:15
OpenMPCD::Utility::MathematicalConstants::pi
OPENMPCD_CUDA_HOST_AND_DEVICE T pi()
Returns the value of .
Definition: MathematicalConstants.hpp:29
Macros.hpp