diff options
author | marcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-10-24 06:04:56 +0000 |
---|---|---|
committer | marcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-10-24 06:04:56 +0000 |
commit | 90d244aded4c1cbc0289b910a0e062e033ee791f (patch) | |
tree | 3bc424bfe2637d5ac51bfe976ea7df04e464386c | |
parent | e5af8e940b2f399d6eb157c96146f6f6bd950793 (diff) | |
download | ruby-90d244aded4c1cbc0289b910a0e062e033ee791f.tar.gz |
* lib/matrix (column): handle negative arguments. cf [ruby-core:23598]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25451 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | lib/matrix.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/matrix.rb b/lib/matrix.rb index d14fdef4f7..a8d9b98ff6 100644 --- a/lib/matrix.rb +++ b/lib/matrix.rb @@ -309,13 +309,13 @@ class Matrix # def column(j) # :yield: e if block_given? - return self if j >= column_size + return self if j >= column_size || j < -column_size row_size.times do |i| yield @rows[i][j] end self else - return nil if j >= column_size + return nil if j >= column_size || j < -column_size col = (0 ... row_size).collect {|i| @rows[i][j] } |