inverse(a: number): number {
    if (a === 0) {
      throw new ArithmeticException();
    }
    return this.expTable[this.modulus - this.logTable[a] - 1];