diff --git a/src/number.vala b/src/number.vala
index 81d2811..5b8b188 100644
--- a/src/number.vala
+++ b/src/number.vala
@@ -887,6 +887,21 @@ public class Number
     /* Sets z = x^y */
     public Number xpowy (Number y)
     {
+        double b;
+        double d;
+        Number c;
+        b = y.to_float ();
+        c = this.ln ();
+        d = c.to_double ();
+        d = d * b;
+
+        if (d > 930.203516311)
+        {
+            /* Translators: Error displayed when attempted to raise x to a very high power y. 2^1342 is the limit of power calculation */
+            mperr (_("The power calculation is out of range"));
+            return new Number.integer (0);
+        }
+
         if (y.is_integer ())
             return xpowy_integer (y.to_integer ());
         else
