add DomainError for ^. part of #5234