Behavior of ^(::Matrix{<:Integer}, ::Integer)
inconsistent with behavior of ^(::Integer, ::Integer)
#23366
Labels
linear algebra
Linear algebra
^(::Matrix{Int64}, ::Int64)
is type unstable. See e.g.which shows
Union{Array{Float64,2}, Array{Int64,2}}
. The reason seems to be that^(A::Matrix{Int64}, p::Int64)
returns aMatrix{Float64}
if p<0.This is inconsistent with the behavior of
^(x::Int64, p::Int64)
, which returns anInt64
if p>=0 or if x==1 or x==-1. Otherwise, it throws aDomainError
.The text was updated successfully, but these errors were encountered: