Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
path: root/src/math
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2010-11-26 19:02:27 +0000
committerStijn Buys <ingar@osirion.org>2010-11-26 19:02:27 +0000
commit772631d07bced1963b54978c7eb86ebfd69f633c (patch)
tree294dd732a9378d604831da6ea73d60c4f8c236d3 /src/math
parenta96da42a7c1232dee986e1f658ee34440f78ac6c (diff)
Brute-force patch subdivision
Diffstat (limited to 'src/math')
-rw-r--r--src/math/functions.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/math/functions.h b/src/math/functions.h
index 8135392..27a068e 100644
--- a/src/math/functions.h
+++ b/src/math/functions.h
@@ -107,6 +107,15 @@ inline void swap(float &x, float &y)
y = tmp;
}
+/// float to the n-th power
+inline float pow(const float x, const size_t pow) {
+ float r = 1;
+ for (size_t i = 1; i <= pow; i++) {
+ r *= x;
+ }
+ return r;
+}
+
} // namespace math
#endif // __INCLUDED_MATH_FUNCTIONS_H__