summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--llimits.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/llimits.h b/llimits.h
index a76c13ed..d0394831 100644
--- a/llimits.h
+++ b/llimits.h
@@ -326,7 +326,8 @@ typedef l_uint32 Instruction;
/* exponentiation */
#if !defined(luai_numpow)
-#define luai_numpow(L,a,b) ((void)L, l_mathop(pow)(a,b))
+#define luai_numpow(L,a,b) \
+ ((void)L, (b == 2) ? (a)*(a) : l_mathop(pow)(a,b))
#endif
/* the others are quite standard operations */