ipdf.h and Real type
authorSam Moore <[email protected]>
Wed, 26 Mar 2014 08:33:02 +0000 (16:33 +0800)
committerSam Moore <[email protected]>
Wed, 26 Mar 2014 08:33:02 +0000 (16:33 +0800)
Real == float for now. Can make a class and overload it later.

Naming convention:

void ThisIsAFunction(Type this_is_a_var);

src/ipdf [new symlink]
src/ipdf.h [new file with mode: 0644]
src/main.cpp

diff --git a/src/ipdf b/src/ipdf
new file mode 120000 (symlink)
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 (file)
index 0000000..33962d6
--- /dev/null
@@ -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
index e683564..5b8d4b8 100644 (file)
@@ -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;
 }

UCC git Repository :: git.ucc.asn.au