Added optional base modification to log and exp