ionConstants.h
Go to the documentation of this file.
1 
2 #pragma once
3 
4 #include "ionTypes.h"
5 
6 
7 namespace ion
8 {
9 
11  namespace Constants32
12  {
13 
14  float const Pi = 3.14159265359f;
15  float const e = 2.71828182845f;
16 
17  };
18 
20  namespace Constants64
21  {
22 
23  double const Pi = 3.141592653589793238462643383279;
24  double const e = 2.718281828459045235360287471352;
25 
26  };
27 
30  template <typename T>
31  struct Constants
32  {};
33 
34  template <>
35  struct Constants<float>
36  {
37  static float Pi()
38  {
39  return Constants32::Pi;
40  }
41  static float e()
42  {
43  return Constants32::e;
44  }
45  };
46 
47  template <>
48  struct Constants<double>
49  {
50  static double Pi()
51  {
52  return Constants64::Pi;
53  }
54  static double e()
55  {
56  return Constants64::e;
57  }
58  };
59 
60 }
static float Pi()
Definition: ionConstants.h:37
static float e()
Definition: ionConstants.h:41
float const e
Definition: ionConstants.h:15
static double e()
Definition: ionConstants.h:54
Definition: CCatmullRomAdvancedSplineInterpolator.h:7
Defines typedefs for integer and floating point types.
double const e
Definition: ionConstants.h:24
Template-friendly access to Constants32 or Constants64.
Definition: ionConstants.h:31
static double Pi()
Definition: ionConstants.h:50
float const Pi
Definition: ionConstants.h:14
double const Pi
Definition: ionConstants.h:23