summaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/math.C17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/lib/math.C b/src/lib/math.C
index c6319aad4..e590745db 100644
--- a/src/lib/math.C
+++ b/src/lib/math.C
@@ -5,7 +5,9 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* COPYRIGHT International Business Machines Corp. 2011,2014 */
+/* Contributors Listed Below - COPYRIGHT 2011,2016 */
+/* [+] International Business Machines Corp. */
+/* */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); */
/* you may not use this file except in compliance with the License. */
@@ -29,3 +31,16 @@ double sqrt(double x)
return _x;
}
+/*****************************************************************************
+ * pow
+ *****************************************************************************/
+uint64_t pow(const uint32_t base, const uint32_t exp)
+{
+ uint64_t result = 1;
+ for (uint32_t i=1; i <= exp; i++)
+ {
+ result = result * base;
+ }
+ return result;
+}
+
OpenPOWER on IntegriCloud