-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
make I consistently provide identity behavior in type #24396
Conversation
6b170c0
to
9f71294
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically breaking since typeof(I)
is changing. Perhaps worth a NEWS
entry?
…er promotion behavior.
Good call! Rebased out conflict and added a news entry. Thanks! :) Given the approvals and 👍s/❤️s from relevant parties, absent objections or requests for time I plan to merge this change this evening or tomorrow morning. Best! |
@@ -51,7 +51,7 @@ end | |||
end | |||
|
|||
@testset "det and logdet" begin | |||
@test det(I) === 1 | |||
@test det(I) === true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the only bit that gives me pause; I wonder if we should have prod([true,true,true]) === 1
instead of true
. We already have sum([true,true,true]) === 3
so it would kind of make sense for the type of prod
to match, even though 0
and 1
would be the only possible value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps warrants a dedicated issue? :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done: #24425
Thanks all! |
Presently
I
isUniformScaling{Int64}(1)
, which consistently provides identity behavior in value but inconsistently in type:This pull request makes
I
yieldUniformScaling{Bool}(true)
instead, which consistently provides identity behavior not merely in value but also in type. Ref. JuliaLang/LinearAlgebra.jl#454, and particularly the latter paragraphs in JuliaLang/LinearAlgebra.jl#454, which this pull request partially addresses. Best!