more_math 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/more_math/histogram.rb +5 -1
- data/lib/more_math/version.rb +1 -1
- data/more_math.gemspec +3 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1ba84f4d700f11ea528792c07fc7a1b44e055039336ffb9a9081f777637b7609
|
4
|
+
data.tar.gz: 1a783a0247589249a75b9a9475f2d6ebecf21e032c809841f066612191916809
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 01cc841c484126edc0a5c407a20c9649b07cf3d2700115c0b8cc7829a26fc88b10663b68f4f8e05b35721a87ee9f77af296a0a7fb8e859700a543b2b191b4117
|
7
|
+
data.tar.gz: f5ab98072be38fab9f327eed3d7ed88b736c58bff92fb71957a779beba46d90ec36dba863fb68c4c9b351082d93b591af341bc77bbef9bda05627778a9e89407
|
data/lib/more_math/histogram.rb
CHANGED
@@ -36,6 +36,7 @@ module MoreMath
|
|
36
36
|
# Display this histogram to +output+, +width+ is the parameter for
|
37
37
|
# +prepare_display+
|
38
38
|
def display(output = $stdout, width = 50)
|
39
|
+
width >= 1 or raise ArgumentError, "width needs to be >= 1"
|
39
40
|
for r in rows
|
40
41
|
output << output_row(r, width)
|
41
42
|
end
|
@@ -56,8 +57,11 @@ module MoreMath
|
|
56
57
|
else
|
57
58
|
left_width = width
|
58
59
|
end
|
60
|
+
if left_width < 0
|
61
|
+
left_width = width
|
62
|
+
end
|
59
63
|
factor = left_width.to_f / max_count
|
60
|
-
bar_width = (count * factor).
|
64
|
+
bar_width = (count * factor).round
|
61
65
|
bar = ?* * bar_width
|
62
66
|
if @with_counts
|
63
67
|
bar += count.to_s.rjust(width - bar_width)
|
data/lib/more_math/version.rb
CHANGED
data/more_math.gemspec
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
-
# stub: more_math 1.0.
|
2
|
+
# stub: more_math 1.0.1 ruby lib
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "more_math".freeze
|
6
|
-
s.version = "1.0.
|
6
|
+
s.version = "1.0.1"
|
7
7
|
|
8
8
|
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
9
9
|
s.require_paths = ["lib".freeze]
|
10
10
|
s.authors = ["Florian Frank".freeze]
|
11
|
-
s.date = "2023-05-
|
11
|
+
s.date = "2023-05-29"
|
12
12
|
s.description = "Library that provides more mathematical functions/algorithms than standard Ruby.".freeze
|
13
13
|
s.email = "flori@ping.de".freeze
|
14
14
|
s.extra_rdoc_files = ["README.md".freeze, "lib/more_math.rb".freeze, "lib/more_math/cantor_pairing_function.rb".freeze, "lib/more_math/constants/functions_constants.rb".freeze, "lib/more_math/continued_fraction.rb".freeze, "lib/more_math/distributions.rb".freeze, "lib/more_math/entropy.rb".freeze, "lib/more_math/exceptions.rb".freeze, "lib/more_math/functions.rb".freeze, "lib/more_math/histogram.rb".freeze, "lib/more_math/linear_regression.rb".freeze, "lib/more_math/newton_bisection.rb".freeze, "lib/more_math/numberify_string_function.rb".freeze, "lib/more_math/permutation.rb".freeze, "lib/more_math/ranking_common.rb".freeze, "lib/more_math/sequence.rb".freeze, "lib/more_math/sequence/moving_average.rb".freeze, "lib/more_math/sequence/refinement.rb".freeze, "lib/more_math/string_numeral.rb".freeze, "lib/more_math/subset.rb".freeze, "lib/more_math/version.rb".freeze]
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: more_math
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Florian Frank
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-05-
|
11
|
+
date: 2023-05-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gem_hadar
|