-
-
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 prod(::Vector{Bool})::Int
?
#24425
Comments
Personally I like the idea of deprecating |
I don't think it's justifiable not to allow |
-1. The same difference exists for the scalar operation:
I don't see much reason to introduce a different result type just because a reduction is being done. |
Based on triage discussion, we seem to be at a local optimum, with booleans behaving as strong zero and strong one for multiplication whereas as long as booleans are numbers, summing them is useful. FWIW, Knuth is very pro strong zero as a concept: https://arxiv.org/abs/math/9205211. |
Came up over here: #24396 (comment). We already have
sum([false,false,false]) === 0
but we haveprod([true,true,true]) === true
. I understand the logic that the value of the product can only betrue
orfalse
so it might as well be of typeBool
, but I think it makes sense thatsum
andprod
return the same type; if someone really wants aBool
result, they can always useall
.The text was updated successfully, but these errors were encountered: