@Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }

        if (this == obj) {
            return true;
        }

        if (!(obj instanceof PAdic)) {
            return false;
        }

        PAdic number = (PAdic) obj;

        if (this.base != number.base) {
            return false;
        }

        if (this.order != number.order) {
            return false;
        }

        for (int i = 0; i < PAdic.limit; ++i) {
            if (this.digits[i] != number.digits[i]) {
                return false;
            }
        }

        return true;
    }