Skip to content
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

Index operations #8

Closed
RobolabGs2 opened this issue Oct 27, 2019 · 0 comments
Closed

Index operations #8

RobolabGs2 opened this issue Oct 27, 2019 · 0 comments
Assignees
Labels
bug Something isn't working C

Comments

@RobolabGs2
Copy link
Member

Our matrix and vector throw exceptions in with cases, but standard:

irb(main):008:0> require 'matrix'
=> true
irb(main):009:0> v = Vector[1, 2, 3]
...
rb(main):018:0> v[-4]
=> nil
irb(main):019:0> v[-4] = 4
...
IndexError (given index -4 is outside of -3...3)
irb(main):020:0> v[-3] = 4
=> 4
irb(main):021:0> v
=> Vector[4, 2, 3]
irb(main):022:0> v[3] = 40
...
IndexError (given index 3 is outside of -3...3)
irb(main):014:0> m = Matrix[[1, 2], [3, 4]]
=> Matrix[[1, 2], [3, 4]]
irb(main):015:0> m[-1, -2]
=> 3
irb(main):016:0> m[-1, -3]
=> nil
@RobolabGs2 RobolabGs2 added the bug Something isn't working label Oct 27, 2019
@RobolabGs2 RobolabGs2 added the C label Oct 28, 2019
@SID37 SID37 closed this as completed Oct 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working C
Projects
None yet
Development

No branches or pull requests

2 participants