Skip to content

Conversation

@getzze
Copy link
Contributor

@getzze getzze commented Sep 17, 2021

Closes #41402

Return the dest array if any dimension of src is 0. Because of the 0-dimension, no value is stored in the array and dest==src.

@StefanKarpinski
Copy link
Member

Terminological nit: these arrays are empty, not zero-dimensional. Zero-dimensional arrays are non-empty and have a single element. Arrays where at least one dimension has size zero are empty. Zero-dimensional arrays cannot be empty because there is no dimension to have size zero.

@JeffBezanson JeffBezanson added arrays [a, r, r, a, y, s] bugfix This change fixes an existing bug labels Sep 17, 2021
@getzze getzze changed the title Circshift no longer throws error for a 0-dim array Circshift no longer throws error for empty array Sep 18, 2021
@stevengj stevengj merged commit 144ed87 into JuliaLang:master Sep 21, 2021
KristofferC pushed a commit that referenced this pull request Sep 23, 2021
* Test circshift with 0-dim array

* circshift returns dest array for a 0-dim array

* use isempty instead of checking size

(cherry picked from commit 144ed87)
KristofferC pushed a commit that referenced this pull request Sep 28, 2021
* Test circshift with 0-dim array

* circshift returns dest array for a 0-dim array

* use isempty instead of checking size
LilithHafner pushed a commit to LilithHafner/julia that referenced this pull request Feb 22, 2022
* Test circshift with 0-dim array

* circshift returns dest array for a 0-dim array

* use isempty instead of checking size
LilithHafner pushed a commit to LilithHafner/julia that referenced this pull request Mar 8, 2022
* Test circshift with 0-dim array

* circshift returns dest array for a 0-dim array

* use isempty instead of checking size
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

arrays [a, r, r, a, y, s] bugfix This change fixes an existing bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

circshift throws DivideError with empty array

5 participants