Skip to content

Commit 29155d4

Browse files
authored
Update generic.jl
use `convert` as a more generic constructor
1 parent 321c710 commit 29155d4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/generic.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1846,7 +1846,7 @@ julia> det(BigInt[1 0; 2 2]) # exact integer determinant
18461846
function det(A::AbstractMatrix{T}) where {T}
18471847
if istriu(A) || istril(A)
18481848
S = promote_type(T, typeof((one(T)*zero(T) + zero(T))/one(T)))
1849-
return prod(S, @view A[diagind(A)])
1849+
return prod(Base.Fix1(convert, S), @view A[diagind(A)])
18501850
end
18511851
return det(lu(A; check = false))
18521852
end

0 commit comments

Comments
 (0)