From e24f0693b4e3989e625448009175c06e1e6e08d4 Mon Sep 17 00:00:00 2001 From: Sam Moore Date: Wed, 26 Mar 2014 16:33:02 +0800 Subject: [PATCH] ipdf.h and Real type Real == float for now. Can make a class and overload it later. Naming convention: void ThisIsAFunction(Type this_is_a_var); --- src/ipdf | 1 + src/ipdf.h | 11 +++++++++++ src/main.cpp | 9 ++++++++- 3 files changed, 20 insertions(+), 1 deletion(-) create mode 120000 src/ipdf create mode 100644 src/ipdf.h diff --git a/src/ipdf b/src/ipdf new file mode 120000 index 0000000..f5811ab --- /dev/null +++ b/src/ipdf @@ -0,0 +1 @@ +../bin/ipdf \ No newline at end of file diff --git a/src/ipdf.h b/src/ipdf.h new file mode 100644 index 0000000..33962d6 --- /dev/null +++ b/src/ipdf.h @@ -0,0 +1,11 @@ +#ifndef _IPDF_H +#define _IPDF_H + +namespace IPDF +{ + typedef float Real; + inline float RealToFloat(Real r) {return r;} +} + + +#endif //_IPDF_H diff --git a/src/main.cpp b/src/main.cpp index e683564..5b8d4b8 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,7 +1,14 @@ #include "common.h" +#include "ipdf.h" + +using namespace std; +using namespace IPDF; + int main(int argc, char ** argv) { - Debug("It's alive!"); + Real a = 10; + Real b = 20; + Debug("a*b = %f", RealToFloat(a*b)); return 0; } -- 2.20.1