diff --git a/src/calc.cpp b/src/calc.cpp
index a5aa766ca3798c786b1541274f8dade45bf4bb62..aa0c92cc6a55c06bd204d3098e4b506b15bc6c96 100644
--- a/src/calc.cpp
+++ b/src/calc.cpp
@@ -2,11 +2,13 @@
 
 #include <stack>
 #include <stdexcept>
+#include <cmath>
 
 int plus(    int a, int b) { return a + b; }
 int minus(   int a, int b) { return a - b; }
 int multiply(int a, int b) { return a * b; }
 int divide(  int a, int b) { return a / b; }
+int power(     int a, int b) { return std::pow(a, b); }
 int modulo(  int a, int b) { return a % b; }
 
 int pop_stack(auto &stack) {
@@ -30,6 +32,7 @@ int evaluate(const std::string &s) {
     case '-': change_stack_state(minus,    stack); break;
     case '*': change_stack_state(multiply, stack); break;
     case '/': change_stack_state(divide,   stack); break;
+    case '^': change_stack_state(power,      stack); break;
     case '%': change_stack_state(modulo,   stack); break;
     case '0'...'9': stack.push(c - '0'); break;
     default:
diff --git a/test/test.cpp b/test/test.cpp
index 3d4488564097c888884e6fcf316580447ce8e657..17208e7fced40d6bcfd203a7069d456612650be2 100644
--- a/test/test.cpp
+++ b/test/test.cpp
@@ -7,6 +7,12 @@ TEST_CASE( "some example calculations", "[calc]") {
   REQUIRE( evaluate("12+2-3*") == 3 );
 }
 
+TEST_CASE( "pow function works", "[calc]") {
+  REQUIRE( evaluate("22^") == 4 );
+  REQUIRE( evaluate("43^") == 64 );
+  REQUIRE_FALSE( evaluate("11^") == 2);
+}
+
 TEST_CASE( "basic addition", "[calc]"){
   REQUIRE( evaluate("55+") == 10); 
   REQUIRE( evaluate("34+") == 7);