diff options
Diffstat (limited to 'test/matrix')
-rw-r--r-- | test/matrix/test_matrix.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/matrix/test_matrix.rb b/test/matrix/test_matrix.rb index b134bfb3a1..8125fb2bcb 100644 --- a/test/matrix/test_matrix.rb +++ b/test/matrix/test_matrix.rb @@ -448,6 +448,12 @@ class TestMatrix < Test::Unit::TestCase assert_equal(Matrix[[67,96],[48,99]], Matrix[[7,6],[3,9]] ** 2) assert_equal(Matrix.I(5), Matrix.I(5) ** -1) assert_raise(Matrix::ErrOperationNotDefined) { Matrix.I(5) ** Object.new } + + m = Matrix[[0,2],[1,0]] + exp = 0b11101000 + assert_equal(Matrix.scalar(2, 1 << (exp/2)), m ** exp) + exp = 0b11101001 + assert_equal(Matrix[[0, 2 << (exp/2)], [1 << (exp/2), 0]], m ** exp) end def test_det |