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