vector_number 0.4.0 → 0.4.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3958070d42eb34b2a76467cda30a4c33e90838a17211d06bf9088311f6cf82ee
4
- data.tar.gz: 5308af739c073e2193ee8199a1118eef011e0aa552cbcceb6a8bae63f8c2da5d
3
+ metadata.gz: 9c128efe318fd49a1d70b41ec6556902cc765a96d3f329fcbd53b8e633aed64a
4
+ data.tar.gz: 807e3c711b0b78d5fbd543b459f4045eb43ca38afe5ec81ed6d9b92bdac18bf8
5
5
  SHA512:
6
- metadata.gz: 515c092ebe57230a92fff99868ccf7fd929fcf9a2aa6d81b10918c68108010b55214bc88fef0112659b513623959c82fd6e8431fbaf16e1917e25d1b07a797a7
7
- data.tar.gz: 9738e48084961b2ac7a6e02853ca30c37d736692ac14b3e49ac72f8adea3a31ebc72ea1751e474c57007ef1aa9d3663aa61a2de3ac3b937192c7ae7bd680a6e4
6
+ metadata.gz: ac7a1cbf596a4020d7b25507fdf68874cd2cded40e6d4a3f7be264612b490ab8f963e188de3130329c95d2c5d0a82af668b3a086a5bd45a8e5709de8ae909010
7
+ data.tar.gz: 523a6544edf0cbded5a13f76c3d128c2cbb972d20fbb6a59999e6f023878b56f851279b726ff44196c7a25c08f22896e63c1ee3424105f5fb5a3c055fabe88fd
data/README.md CHANGED
@@ -1,17 +1,22 @@
1
1
  # VectorNumber
2
2
 
3
- > [!TIP]
4
- > You may be viewing documentation for an older (or newer) version of the gem.
5
- > Check badges below to see what the latest released version is.
6
- > Look at [Changelog](https://github.com/trinistr/vector_number/blob/main/CHANGELOG.md)
7
- > to see all versions, including unreleased changes!
8
-
9
- Latest: [![Gem Version](https://badge.fury.io/rb/vector_number.svg?icon=si%3Arubygems)](https://rubygems.org/gems/vector_number)
3
+ [![Gem Version](https://badge.fury.io/rb/vector_number.svg?icon=si%3Arubygems)](https://rubygems.org/gems/vector_number)
10
4
  [![CI](https://github.com/trinistr/vector_number/actions/workflows/CI.yaml/badge.svg)](https://github.com/trinistr/vector_number/actions/workflows/CI.yaml)
11
5
 
6
+ > [!TIP]
7
+ > You may be viewing documentation for an older (or newer) version of the gem. Look at [Changelog](https://github.com/trinistr/dicey/blob/main/CHANGELOG.md) to see all versions, including unreleased changes.
8
+
12
9
  ***
13
10
 
14
- A library to add together anything: be it a number, string or random Object, it can be added together with math operations available on results in a real vector space, though some operations are modeled on hypercomplex numbers.
11
+ VectorNumber is a Ruby gem that provides a Numeric-like experience for doing arithmetics on heterogeneous objects, with more advanced operations based on real vector spaces available when needed.
12
+
13
+ Features:
14
+ - [Add and subtract](#basics) (almost) any object, with no setup or declaration.
15
+ - [Multiply and divide](#basics) vectors by any real number to create 1.35 of an array and -2 of a string. What does that mean? Only you know!
16
+ - [Use vectors instead of inbuilt numbers](#numerical-behavior) in most situtations with no difference in behavior. Or, use familiar methods from numerics with sane semantics!
17
+ - [Enumerate vectors in a hash-like fashion](#enumeration-and-hash-like-behavior), or transform to an array or hash as needed.
18
+ - Enjoy a mix of vector-, complex- and polynomial-like behavior at appropriate times.
19
+ - No dependencies, no extensions. It just works!
15
20
 
16
21
  Similar projects:
17
22
  - [vector_space](https://github.com/tomstuart/vector_space) aims to provide typed vector spaces with limited dimensions and nice formatting;
@@ -20,11 +25,23 @@ Similar projects:
20
25
 
21
26
  However, none of them have been updated in *years*.
22
27
 
23
- ## Installation
28
+ ## Table of contents
24
29
 
25
- VectorNumber does not have any dependencies and does not include extensions.
30
+ - [Installation](#installation)
31
+ - [Ruby engine support status](#ruby-engine-support-status)
32
+ - [Usage](#usage)
33
+ - [Basics](#basics)
34
+ - [(Somewhat) advanced usage](#somewhat-advanced-usage)
35
+ - [Frozenness](#frozenness)
36
+ - [Numerical behavior](#numerical-behavior)
37
+ - [Enumeration and hash-like behavior](#enumeration-and-hash-like-behavior)
38
+ - [Development](#development)
39
+ - [Contributing](#contributing)
40
+ - [License](#license)
26
41
 
27
- Install with `gem` (available from [0.2.4](https://github.com/trinistr/vector_number/tree/v0.2.4)):
42
+ ## Installation
43
+
44
+ Install with `gem`:
28
45
  ```sh
29
46
  gem install vector_number
30
47
  ```
@@ -34,52 +51,100 @@ If using Bundler, add gem to your Gemfile:
34
51
  gem "vector_number"
35
52
  ```
36
53
 
54
+ ### Ruby engine support status
55
+
56
+ VectorNumber is developed on MRI (CRuby) but should work on other engines too.
57
+ - TruffleRuby: there are some minor differences in behavior, but otherwise works as expected.
58
+ - JRuby: significant problems, but may work, currently not tested.
59
+ - Other engines: untested, but should work, depending on compatibility with MRI.
60
+
37
61
  ## Usage
38
62
 
39
- Usage is pretty simple and intuitive:
40
- ```ruby
41
- require "vector_number"
42
- VectorNumber["string"] + "str" # => (1⋅'string' + 1⋅'str')
43
- VectorNumber[5] + VectorNumber["string"] - 0.5 # => (4.5 + 1⋅'string')
44
- VectorNumber["string", "string", "string", "str"] # => (3⋅'string' + 1⋅'str')
45
- VectorNumber[:s] * 2 + VectorNumber["string"] * 0.3 # => (2⋅s + 0.3⋅'string')
46
- VectorNumber[:s] / 3 # => (1/3⋅s)
47
- 1/3r * VectorNumber[[]] # => (1/3⋅[])
48
- ```
63
+ > [!Note]
64
+ > - Latest API documentation from `main` branch is automatically deployed to [GitHub Pages](https://trinistr.github.io/vector_number).
65
+ > - Documentation for published versions is available on [RubyDoc](https://rubydoc.info/gems/vector_number).
66
+
67
+ ### Basics
49
68
 
50
- VectorNumbers are mostly useful for summing up heterogeneous objects:
69
+ VectorNumbers are mostly useful for tallying up heterogeneous objects:
51
70
  ```ruby
52
- sum = VectorNumber[]
53
- [4, "death", "death", 13, nil].each { sum = sum + _1 }
71
+ sum = [4, "death", "death", 13, nil].reduce(VectorNumber[], :+)
54
72
  sum # => (17 + 2⋅'death' + 1⋅)
55
- sum.to_a # => [[1, 17], ["death", 2], [nil, 1]]
56
73
  sum.to_h # => {1=>17, "death"=>2, nil=>1}
57
- ```
74
+ sum.to_a # => [[1, 17], ["death", 2], [nil, 1]]
58
75
 
59
- Alternatively, the same result can be equivalently (and more efficiently) achieved by
60
- passing all values to a constructor:
61
- ```ruby
76
+ # Alternatively, the same result can be equivalently (and more efficiently)
77
+ # achieved by passing all values to a constructor:
62
78
  VectorNumber[4, "death", "death", 13, nil]
63
79
  VectorNumber.new([4, "death", "death", 13, nil])
64
80
  ```
65
81
 
66
- ## Ruby engine support status
82
+ Doing arithmetic with vectors is simple and intuitive:
83
+ ```ruby
84
+ VectorNumber["string"] + "string" # => (2⋅'string')
85
+ VectorNumber["string"] - "str" # => (1⋅'string' - 1⋅'str')
86
+ VectorNumber[5] + VectorNumber["string"] - 0.5 # => (4.5 + 1⋅'string')
87
+ VectorNumber["string", "string", "string", "str"] # => (3⋅'string' + 1⋅'str')
88
+ # Multiply and divide by any real number:
89
+ VectorNumber[:s] * 2 + VectorNumber["string"] * 0.3 # => (2⋅s + 0.3⋅'string')
90
+ VectorNumber[:s] / VectorNumber[3] # => (1/3⋅s)
91
+ # Multiplication even works when the left operand is a regular number:
92
+ 1/3r * VectorNumber[[]] # => (1/3⋅[])
93
+ ```
67
94
 
68
- VectorNumber is developed on MRI (CRuby) but should work on other engines too.
69
- - TruffleRuby: works as expected, but there are differences in core Ruby code, so some tests fail.
70
- - JRuby: significant problems, but may work, currently not tested.
71
- - Other engines: untested, but should work, depending on compatibility.
95
+ ### (Somewhat) advanced usage
96
+
97
+ > [!TIP]
98
+ > Look at [API documentation](https://rubydoc.info/gems/vector_number) for all methods.
99
+
100
+ #### Frozenness
101
+ VectorNumbers are always frozen, as a number should be. However, they hold references to units (keys), which aren't frozen or duplicated. It is the user's responsibility to ensure that keys aren't mutated, the same as it is for Hash.
102
+
103
+ As vectors are immutable, `+@`, `dup` and `clone` return the same instance.
104
+
105
+ #### Numerical behavior
106
+ VectorNumbers implement most of the methods you can find in `Numeric`, with appropriate behavior. For example:
107
+ - `abs` (`magnitude`) calculates length of the vector;
108
+ - `infinite?` checks whether any coefficient is infinite (or NaN), in the same way as `Complex` does it;
109
+ - `positive?` is true if all coefficients are positive, the same for `negative?` (though this is different from `Complex`) (and they can both be false);
110
+ - `round` and friends round each coefficient, with all the bells and whistles;
111
+ - `div` and `%` perform division and remainder operations elementwise;
112
+ - `5 < VectorNumber[6]` returns `true` and `5 < VectorNumber["string"]` raises `ArgumentError`, etc.
113
+
114
+ VectorNumbers, if only consisting of a real number, can mostly be used interchangeably with core numbers due to `coerce` and conversion (`to_i`, etc.) methods. They can even be used as array indices! Due to including `Comparable`, they can also participate in comparison and sorting.
115
+
116
+ #### Enumeration and Hash-like behavior
117
+ VectorNumbers implement `each` (`each_pair`) in the same way as Hash does, allowing `Enumerable` methods to be used in a familiar way.
118
+
119
+ There are also the usual `[]`, `unit?` (`key?`), `units` (`keys`), `coefficients` (`values`) methods. `to_h` and `to_a` can be used if a regular Hash or Array is needed.
120
+
121
+ > [!NOTE]
122
+ > Be aware that `[]` always returns `0` for "missing" units. `unit?` will return `false` for them.
72
123
 
73
124
  ## Development
74
125
 
75
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests, `rake rubocop` to check code, `rake steep` to check typing or just `rake` to do everything. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
126
+ After checking out the repo, run `bundle install` to install dependencies. Then, run `rake spec` to run the tests, `rake rubocop` to lint code and check style compliance, `rake rbs` to validate signatures or just `rake` to do everything above. There is also `rake steep` to check typing, and `rake docs` to generate YARD documentation.
127
+
128
+ You can also run `bin/console` for an interactive prompt that will allow you to experiment, or `bin/benchmark` to run a benchmark script and generate a StackProf flamegraph.
129
+
130
+ To install this gem onto your local machine, run `rake install`.
76
131
 
77
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, change Next version in `CHANGELOG.md`, commit changes and tag the commit. Alternatively, an appropriate `rake bump:{major|minor|patch}` command can be used.
132
+ To release a new version, run `rake version:{major|minor|patch}`, and then run `rake release`, which will build the package and push the `.gem` file to [rubygems.org](https://rubygems.org). After that, push the release commit and tags to the repository with `git push --follow-tags`.
78
133
 
79
134
  ## Contributing
80
135
 
81
136
  Bug reports and pull requests are welcome on GitHub at [https://github.com/trinistr/vector_number]().
82
137
 
138
+ ### Checklist for a new or updated feature
139
+
140
+ - Running `rake spec` reports 100% coverage (unless it's impossible to achieve in one run).
141
+ - Running `rake rubocop` reports no offenses.
142
+ - Running `rake steep` reports no new warnings or errors.
143
+ - Tests cover the behavior and its interactions. 100% coverage *is not enough*, as it does not guarantee that all code paths are tested.
144
+ - Documentation is up-to-date: generate it with `rake docs` and read it.
145
+ - "*CHANGELOG.md*" lists the change if it has impact on users.
146
+ - "*README.md*" is updated if the feature should be visible there.
147
+
83
148
  ## License
84
149
 
85
- The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
150
+ This gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT), see [LICENSE.txt](https://github.com/trinistr/vector_number/blob/main/LICENSE.txt).
@@ -45,6 +45,7 @@ class VectorNumber
45
45
  #
46
46
  # Values are considered equal only if +other+ is a VectorNumber
47
47
  # and it has exactly the same units and coefficients, though possibly in a different order.
48
+ # Additionally, `a.eql?(b)` implies `a.hash == b.hash`.
48
49
  #
49
50
  # Note that {#options} are not considered for equality.
50
51
  #
@@ -69,6 +70,22 @@ class VectorNumber
69
70
  end
70
71
  end
71
72
 
73
+ # Generate an Integer hash value for self.
74
+ #
75
+ # Hash values are stable during runtime, but not between processes.
76
+ #
77
+ # @example
78
+ # VectorNumber["b", "a"].hash # => 3081872088394655324
79
+ # VectorNumber["a", "b", mult: :cross].hash # => 3081872088394655324
80
+ # VectorNumber["b", "c"].hash # => -1002381358514682371
81
+ #
82
+ # @return [Integer]
83
+ #
84
+ # @since 0.4.2
85
+ def hash
86
+ [self.class, @data].hash
87
+ end
88
+
72
89
  # Compare to +other+ and return -1, 0, or 1
73
90
  # if +self+ is less than, equal, or larger than +other+.
74
91
  #
@@ -111,9 +111,11 @@ class VectorNumber
111
111
  else :half_up
112
112
  end
113
113
  new { _1.is_a?(BigDecimal) ? _1.round(digits, bd_mode) : _1.round(digits, half:) }
114
+ # :nocov:
114
115
  else
115
116
  new { _1.round(digits, half:) }
116
117
  end
118
+ # :nocov:
117
119
  end
118
120
  end
119
121
  end
@@ -2,5 +2,5 @@
2
2
 
3
3
  class VectorNumber
4
4
  # @return [String]
5
- VERSION = "0.4.0"
5
+ VERSION = "0.4.2"
6
6
  end
@@ -208,6 +208,8 @@ class VectorNumber
208
208
 
209
209
  def eql?: (in_value_type other) -> bool
210
210
 
211
+ def hash: () -> Integer
212
+
211
213
  def <=>: (in_value_type other) -> Integer?
212
214
  end
213
215
 
metadata CHANGED
@@ -1,26 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vector_number
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexandr Bulancov
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2025-07-07 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies: []
13
- description:
14
- email:
12
+ description: |
13
+ VectorNumber provides a Numeric-like experience for doing arithmetics on heterogeneous objects, with more advanced operations based on real vector spaces available when needed.
14
+
15
+ Features:
16
+ - Add and subtract (almost) any object, with no setup or declaration.
17
+ - Multiply and divide vectors by any real number to create 1.35 of an array and -2 of a string. What does that mean? Only you know!
18
+ - Use vectors instead of inbuilt numbers in most situtations with no difference in behavior. Or, use familiar methods from numerics with sane semantics!
19
+ - Enumerate vectors in a hash-like fashion, or transform to an array or hash as needed.
20
+ - Enjoy a mix of vector-, complex- and polynomial-like behavior at appropriate times.
21
+ - No dependencies, no extensions. It just works!
15
22
  executables: []
16
23
  extensions: []
17
24
  extra_rdoc_files:
18
25
  - README.md
19
- - CHANGELOG.md
20
- - LICENSE.txt
21
26
  files:
22
- - CHANGELOG.md
23
- - LICENSE.txt
24
27
  - README.md
25
28
  - lib/vector_number.rb
26
29
  - lib/vector_number/comparing.rb
@@ -39,16 +42,13 @@ licenses:
39
42
  metadata:
40
43
  homepage_uri: https://github.com/trinistr/vector_number
41
44
  bug_tracker_uri: https://github.com/trinistr/vector_number/issues
42
- documentation_uri: https://rubydoc.info/gems/vector_number/0.4.0
43
- source_code_uri: https://github.com/trinistr/vector_number/tree/v0.4.0
44
- changelog_uri: https://github.com/trinistr/vector_number/blob/v0.4.0/CHANGELOG.md
45
+ documentation_uri: https://rubydoc.info/gems/vector_number/0.4.2
46
+ source_code_uri: https://github.com/trinistr/vector_number/tree/v0.4.2
47
+ changelog_uri: https://github.com/trinistr/vector_number/blob/v0.4.2/CHANGELOG.md
45
48
  rubygems_mfa_required: 'true'
46
- post_install_message:
47
49
  rdoc_options:
48
50
  - "--main"
49
51
  - README.md
50
- - "--files"
51
- - CHANGELOG.md,LICENSE.txt
52
52
  require_paths:
53
53
  - lib
54
54
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -62,8 +62,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
62
62
  - !ruby/object:Gem::Version
63
63
  version: '0'
64
64
  requirements: []
65
- rubygems_version: 3.4.19
66
- signing_key:
65
+ rubygems_version: 3.6.9
67
66
  specification_version: 4
68
- summary: A library to add together anything.
67
+ summary: Add, subtract and do math with any objects
69
68
  test_files: []
data/CHANGELOG.md DELETED
@@ -1,162 +0,0 @@
1
- # Changelog
2
-
3
- All notable changes to this project will be documented in this file.
4
-
5
- The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
- and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
-
8
- ## [Next]
9
- ## [v0.4.0] — 2025-07-07
10
-
11
- **Changed**
12
- - [🍄 BREAKING] Change `R` and `I` constants to be `1` and `2` instead of `0i` and `1i` respectively.
13
- Their values are still semi-private and should not be relied on.
14
- - [🍄 BREAKING] Calling `new` with an unsupported value now raises `ArgumentError` instead of treating it like air.
15
- - Optimize various initialization paths. It is now 1.5-2.5 times faster, depending on arguments.
16
- - [🚀 CI] Disable JRuby testing on CI.
17
-
18
- [Compare v0.3.1...main](https://github.com/trinistr/vector_number/compare/v0.3.1...main)
19
-
20
- ## [v0.3.1] — 2025-06-21
21
-
22
- This is mostly a documentation update with a side of improved gemspec.
23
-
24
- **Changed**
25
- - Improve method documentation and unify documentation style across the board.
26
- - Improve gemspec:
27
- - change source code and changelog links to point to a tagged commit;
28
- - add links to bugtracker and documentation (for appropriate version);
29
- - properly add CHANGELOG.md to doc generation.
30
- - Improve documentation for NumericRefinements to include examples and more info.
31
- - `#dup` is now an alias of `#+@` with no change in function.
32
- - `#abs` is now calculated from `#abs2` instead of the other way around to reduce errors.
33
-
34
- **Fixed**
35
- - Correct broken changelog link in gem metadata.
36
-
37
- [Compare v0.3.0...v0.3.1](https://github.com/trinistr/vector_number/compare/v0.3.0...v0.3.1)
38
-
39
- ## [v0.3.0] — 2025-05-12
40
-
41
- **Added**
42
- - Add aliases to other operators:
43
- `#neg` for `#-@`, `#add` for `#+`, `#sub` for `#-`, `#mult` for `#*`.
44
- `#+@` was already practically aliased by `#dup`.
45
-
46
- **Changed**
47
- - [🍄 BREAKING] Long-existing but broken options feature is now fixed.
48
- When creating new vector through any operation, participating vector's options
49
- are copied to the new one. When several vectors are present, only first one matters.
50
- - Both `#+@` and `#dup` are now aliases of `#itself` instead of full methods.
51
- - [🚀 CI] "CI" workflow now reports status of all checks,
52
- excluding allowed-to-fail workflows (currently JRuby and TruffleRuby).
53
-
54
- [Compare v0.2.6...v0.3.0](https://github.com/trinistr/vector_number/compare/v0.2.6...v0.3.0)
55
-
56
- ## [v0.2.6] — 2025-04-30
57
-
58
- **Added**
59
- - Add `#div`, `#%` (aliased as `#modulo`), `#divmod` and `#remainder` methods.
60
- - Add `#quo` alias to `#/`.
61
-
62
- **Fixed**
63
- - `#/`, `#fdiv` as well as new division methods now properly check for division by zero.
64
- VectorNumber does not support this as not all Numeric classes do.
65
-
66
- **Changed**
67
- - [🚀 CI] Add Ruby 3.4 to CI.
68
-
69
- [Compare v0.2.5...v0.2.6](https://github.com/trinistr/vector_number/compare/v0.2.5...v0.2.6)
70
-
71
- ## [v0.2.5] — 2025-02-26
72
-
73
- Technical update after release to rubygems.org.
74
- README was updated to reflect this change.
75
-
76
- [Compare v0.2.4...v0.2.5](https://github.com/trinistr/vector_number/compare/v0.2.4...v0.2.5)
77
-
78
- ## [v0.2.4] — 2025-02-26
79
-
80
- **Added**
81
- - Add hash-like methods `#[]` and `#unit?` (aliased as `#key?`).
82
-
83
- **Changed**
84
- - [🍄 BREAKING] Change `positive?` and `negative?` to no longer return `nil`
85
- when number is neither strictly positive or negative,
86
- these cases will now return `false`.
87
- - Make `VectorNumber.new` accept options when initializing from a VectorNumber
88
- instead of only copying. Options will be merged.
89
- - Remove `Initializing` module, move its methods to the actual class.
90
- - Update development gems' versions.
91
-
92
- **Fixed**
93
- - `#dup` and `#clone` now behave exactly like Numeric versions, preventing unfreezing.
94
-
95
- [Compare v0.2.3...v0.2.4](https://github.com/trinistr/vector_number/compare/v0.2.3...v0.2.4)
96
-
97
- ## [v0.2.3] — 2024-10-15
98
-
99
- **Fixed**
100
- - BigDecimal tests are now properly skipped when BigDecimal is not available, instead of always.
101
-
102
- [Compare v0.2.2...v0.2.3](https://github.com/trinistr/vector_number/compare/v0.2.2...v0.2.3)
103
-
104
- ## [v0.2.2] — 2024-10-07
105
-
106
- **Added**
107
- - Add `#abs` (aliased as `#magnitude`) and `#abs2`.
108
- - Add `#ceil`, `#floor` and `#round`.
109
-
110
- **Changed**
111
- - [🚀 CI] Add ruby 3.1.0, covering the earliest supported version, and ruby-next (3.4) to CI.
112
- - [🚀 CI] Add JRuby and TruffleRuby to CI, without full support.
113
- - [🚀 CI] Make tests runnable even without available `bigdecimal` gem.
114
-
115
- **Fixed**
116
- - `Kernel#BigDecimal` refinement now correctly works without `ndigits` argument.
117
-
118
- [Compare v0.2.1...v0.2.2](https://github.com/trinistr/vector_number/compare/v0.2.1...v0.2.2)
119
-
120
- ## [v0.2.1] — 2024-08-24
121
-
122
- **Added**
123
- - Add `#*` and `#/` for working with real numbers.
124
- - Add `#fdiv`, `#truncate`, `#nonnumeric?` and `#integer?`.
125
-
126
- **Changed**
127
- - Allow to use fully real VectorNumbers as real numbers.
128
-
129
- **Fixed**
130
- - Fix reversed result in refined `#<=>`.
131
-
132
- **Removed**
133
- - Remove `#to_str`, as VectorNumber is not a String-like object.
134
- - Due to the above, `Kernel.BigDecimal` no longer works without refinements.
135
-
136
- [Compare v0.2.0...v0.2.1](https://github.com/trinistr/vector_number/compare/v0.2.0...v0.2.1)
137
-
138
- ## [v0.2.0] — 2024-08-19
139
-
140
- **Added**
141
- - VectorNumbers can be created from any object or collection.
142
- - Addition and subtraction are supported.
143
- - VectorNumbers are mostly interoperable with core numbers.
144
-
145
- [Compare v0.1.0...v0.2.0](https://github.com/trinistr/vector_number/compare/v0.1.0...v0.2.0)
146
-
147
- ## [v0.1.0] — 2024-05-09
148
-
149
- - Initial work.
150
-
151
- [Next]: https://github.com/trinistr/vector_number/tree/main
152
- [v0.3.1]: https://github.com/trinistr/vector_number/tree/v0.3.1
153
- [v0.3.0]: https://github.com/trinistr/vector_number/tree/v0.3.0
154
- [v0.2.6]: https://github.com/trinistr/vector_number/tree/v0.2.6
155
- [v0.2.5]: https://github.com/trinistr/vector_number/tree/v0.2.5
156
- [v0.2.4]: https://github.com/trinistr/vector_number/tree/v0.2.4
157
- [v0.2.3]: https://github.com/trinistr/vector_number/tree/v0.2.3
158
- [v0.2.2]: https://github.com/trinistr/vector_number/tree/v0.2.2
159
- [v0.2.1]: https://github.com/trinistr/vector_number/tree/v0.2.1
160
- [v0.2.0]: https://github.com/trinistr/vector_number/tree/v0.2.0
161
- [v0.1.0]: https://github.com/trinistr/vector_number/tree/v0.1.0
162
- [🚀 CI]: https://github.com/trinistr/vector_number/actions/workflows/CI.yaml
data/LICENSE.txt DELETED
@@ -1,21 +0,0 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2024-2025 Alexandr Bulancov
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in
13
- all copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- THE SOFTWARE.