Bobbi Towers / May 28 2019

Fractional exponents

1. Exponential to radical form

(defn exp->rad [[base [numer denom]]]
     (str "\\sqrt[" denom "]{" base "^" numer "}"))

(exp->rad ['z [3 4]])
"\sqrt[4]{z^3}"

2. Radical to exponential form

2.1. Radical with exponent

(defn rad-exp->exp [[[radicand index] power]]
  (str radicand "^\\frac{" power "}{" index "}"))

(rad-exp->exp [['a 7] 2])
"a^\frac{2}{7}"

2.2. Root of exponent

(defn root-exp->exp [[[radicand power] index]]
  (str radicand "^\\frac{" power "}{" index "}"))

(root-exp->exp [['k 5] 6])
"k^\frac{5}{6}"