Skip to content

diag inconsistent behavior #120

@davidlizeng

Description

@davidlizeng

Hi,
This comes up in both Julia 0.2.1 and 0.3.0-prerelease+3544. When I do something like

A = [1 2; 3 4]
diag(A, 2)

I get a bounds error, as expected. But if i do

diag(A, -2)

I get a 0 element array. Is this expected behavior of diag? Shouldn't both be giving bounds errors?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions