Sha256: 5b2b89f44fcdc2d73baa9d569cb1e1f48d8312508681d2f326669a73b7948be6

Contents?: true

Size: 672 Bytes

Versions: 25

Compression:

Stored size: 672 Bytes

Contents

# -*- encoding: utf-8 -*-
# -*- frozen_string_literal: true -*-
# -*- warn_indent: true -*-

UnitMeasurements::InformationEntropy = UnitMeasurements.build do
  primitive "nat"

  si_unit "b", value: "1 Sh", aliases: ["bit", "bits"], add_binary_prefixes: true
  si_unit "B", value: [2.pow(3), "b"], aliases: ["byte", "bytes"], add_binary_prefixes: true

  unit "Sh", value: [Math.log(2), "nat"], aliases: ["shannon", "shannons"]
  unit "nat", aliases: ["nit", "nepit", "natural unit of information"]
  unit "nybl", value: [2.pow(2), "b"], aliases: ["nibble", "nibbles", "nybble", "nyble"]
  unit "Hart", value: [Math.log(10), "nat"], aliases: ["hartley", "ban", "dit"]
end

Version data entries

25 entries across 25 versions & 2 rubygems

Version Path
unit_measurements-5.19.0 lib/unit_measurements/unit_groups/information_entropy.rb
unit_measurements-5.18.0 lib/unit_measurements/unit_groups/information_entropy.rb
unit_measurements_us_complete-5.17.0 lib/unit_measurements/unit_groups/information_entropy.rb
unit_measurements-5.17.0 lib/unit_measurements/unit_groups/information_entropy.rb
unit_measurements-5.16.0 lib/unit_measurements/unit_groups/information_entropy.rb
unit_measurements-5.15.0 lib/unit_measurements/unit_groups/information_entropy.rb
unit_measurements-5.14.0 lib/unit_measurements/unit_groups/information_entropy.rb
unit_measurements-5.13.0 lib/unit_measurements/unit_groups/information_entropy.rb
unit_measurements-5.12.0 lib/unit_measurements/unit_groups/information_entropy.rb
unit_measurements-5.11.1 lib/unit_measurements/unit_groups/information_entropy.rb
unit_measurements-5.11.0 lib/unit_measurements/unit_groups/information_entropy.rb
unit_measurements-5.10.0 lib/unit_measurements/unit_groups/information_entropy.rb
unit_measurements-5.9.0 lib/unit_measurements/unit_groups/information_entropy.rb
unit_measurements-5.8.0 lib/unit_measurements/unit_groups/information_entropy.rb
unit_measurements-5.7.0 lib/unit_measurements/unit_groups/information_entropy.rb
unit_measurements-5.6.1 lib/unit_measurements/unit_groups/information_entropy.rb
unit_measurements-5.6.0 lib/unit_measurements/unit_groups/information_entropy.rb
unit_measurements-5.5.0 lib/unit_measurements/unit_groups/information_entropy.rb
unit_measurements-5.4.1 lib/unit_measurements/unit_groups/information_entropy.rb
unit_measurements-5.4.0 lib/unit_measurements/unit_groups/information_entropy.rb