diff options
author | marcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-03-05 23:45:42 +0000 |
---|---|---|
committer | marcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-03-05 23:45:42 +0000 |
commit | b81950f480df1c07f2e6f271d23d066dafdc0e1f (patch) | |
tree | 032b3e9f6e56fd5acb4cb353ea16969c4c9d3a5d /test/matrix/test_vector.rb | |
parent | ce85cd55c621804a39f06e9ce46974fc693ff8df (diff) |
* lib/matrix.rb: Add Vector#round. Patch by Jordan Stephens.
[Fixes GH-802]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49866 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/matrix/test_vector.rb')
-rw-r--r-- | test/matrix/test_vector.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/matrix/test_vector.rb b/test/matrix/test_vector.rb index 3275310b42..77fc68dd2b 100644 --- a/test/matrix/test_vector.rb +++ b/test/matrix/test_vector.rb @@ -157,6 +157,10 @@ class TestVector < Test::Unit::TestCase assert_equal(5, Vector[3, 4].r) end + def test_round + assert_equal(Vector[1.234, 2.345, 3.40].round(2), Vector[1.23, 2.35, 3.4]) + end + def test_covector assert_equal(Matrix[[1,2,3]], @v1.covector) end |