### Calculating Matrix Determinant in Ruby Source: https://github.com/ruby/matrix/blob/master/README.md This example demonstrates how to require the `matrix` library, create a new `Matrix` object, and calculate its determinant. The `determinant` method returns the scalar determinant of the matrix. ```Ruby require 'matrix' m = Matrix[[1, 2], [3, 4]] m.determinant # => -2 ``` -------------------------------- ### Adding Matrix Gem to Gemfile in Ruby Source: https://github.com/ruby/matrix/blob/master/README.md This snippet shows how to include the `matrix` gem in a Ruby application's Gemfile. This ensures that the gem version takes precedence over the built-in library, providing access to the latest features. ```Ruby gem 'matrix' ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.