Convert between exponential and logarithmic form: rational bases