Skip to content

Conversation

@Tokazama
Copy link
Collaborator

@Tokazama Tokazama commented May 5, 2022

Reverts to prior behavior and fixes #58. @chriselrod, It seems like we should only return StaicInt{0} when multiplied with other integers because we should promote. Would that break anything on your end?

@codecov
Copy link

codecov bot commented May 5, 2022

Codecov Report

Merging #59 (31b6e62) into master (16f441f) will increase coverage by 0.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master      #59      +/-   ##
==========================================
+ Coverage   98.80%   98.82%   +0.01%     
==========================================
  Files           8        8              
  Lines         417      424       +7     
==========================================
+ Hits          412      419       +7     
  Misses          5        5              
Impacted Files Coverage Δ
src/float.jl 98.14% <100.00%> (+0.07%) ⬆️
src/int.jl 100.00% <100.00%> (ø)

📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

Copy link
Collaborator

@chriselrod chriselrod left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Taking my example from JuliaArrays/ArrayInterface.jl#262 (comment)
On this PR, I get

julia> using VectorizationBase

julia> using Static: Zero

julia> vx = Vec(ntuple(_->randn(),pick_vector_width(Float64))...)
Vec{8, Float64}<0.11215394134606615, -1.1365862303670673, 0.7231326012882932, -1.280896639969639, -0.41616032433006667, -0.2873581365771947, 0.3625756468339046, 0.7963550919238662>

julia> vx * Zero()
static(0)

julia> Zero() * vx
static(0)

@chriselrod
Copy link
Collaborator

It seems like we should only return StaicInt{0} when multiplied with other integers because we should promote. Would that break anything on your end?

The failing VectorizationBase test wants to preserve static(0), even with Vec{W,Float64}. I'd prefer that behavior to be consistent with Float64.

@Tokazama
Copy link
Collaborator Author

Tokazama commented May 5, 2022

It seems like we should only return StaicInt{0} when multiplied with other integers because we should promote. Would that break anything on your end?

The failing VectorizationBase test wants to preserve static(0), even with Vec{W,Float64}. I'd prefer that behavior to be consistent with Float64.

So merge this as is?

@chriselrod
Copy link
Collaborator

Yes

@Tokazama Tokazama merged commit fe85e11 into master May 5, 2022
@Tokazama Tokazama deleted the zero-mul branch May 5, 2022 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

a*static(0) and static(0)*a no longer return static(0)

3 participants