Sha256: c640c63b4ca3511507cfe0d7a8da6119990465740611ebdfceacfec4aacfaea2

Contents?: true

Size: 321 Bytes

Versions: 13

Compression:

Stored size: 321 Bytes

Contents

require 'facets/enumerable/entropy.rb'
require 'test/unit'

class Test_Enumerable_Entropy < Test::Unit::TestCase

  def test_entropy
    assert_equal( 1.0, %w{ a b }.entropy )
  end

  def test_ideal_entropy
    assert_equal( 1.0, %w{ a b }.ideal_entropy )
    assert_equal( 2.0, %w{ a a b b }.ideal_entropy )
  end

end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
facets-2.8.4 test/core/enumerable/test_entropy.rb
facets-2.8.3 test/core/enumerable/test_entropy.rb
facets-2.8.2 test/core/enumerable/test_entropy.rb
facets-2.8.1 test/core/enumerable/test_entropy.rb
facets-2.8.0 test/core/enumerable/test_entropy.rb
facets-2.7.0 test/core/enumerable/test_entropy.rb
facets-2.6.0 test/core/enumerable/test_entropy.rb
facets-2.4.3 test/core/enumerable/test_entropy.rb
facets-2.4.4 test/core/enumerable/test_entropy.rb
facets-2.5.0 test/core/enumerable/test_entropy.rb
facets-2.5.1 test/core/enumerable/test_entropy.rb
facets-2.4.5 test/core/enumerable/test_entropy.rb
facets-2.5.2 test/core/enumerable/test_entropy.rb