+static int perform_perc(int *a, int *b, int *output)
+{
+ if (a[0] == 0) return FALSE; /* 0% = 0, uninteresting. */
+ if (a[1] > (INT_MAX/100)) return FALSE;
+
+ OUT(output, a[0], a[1]*100);
+ return TRUE;
+}
+
+static int perform_gamma(int *a, int *b, int *output)
+{
+ int asub1[2];
+
+ /*
+ * gamma(a) = (a-1)!
+ *
+ * special case not caught by perform_fact: gamma(1) is 1 so
+ * don't bother.
+ */
+ if (a[0] == 1 && a[1] == 1) return FALSE;
+
+ OUT(asub1, a[0]-a[1], a[1]);
+ return perform_factorial(asub1, b, output);
+}
+
+static int perform_sqrt(int *a, int *b, int *output)
+{
+ int half[2] = { 1, 2 };
+
+ /*
+ * sqrt(0) == 0, sqrt(1) == 1: don't perform unary noops.
+ */
+ if (a[0] == 0 || (a[0] == 1 && a[1] == 1)) return FALSE;
+
+ return perform_exp(a, half, output);
+}
+