tonal-tools 5.2.0 → 5.3.0
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/tonal/attributions.rb +1 -1
- data/lib/tonal/extensions.rb +8 -7
- 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: cf75078baac2ea863202aca76b6c00ab636971096fc676982dcb0114376bca8d
|
4
|
+
data.tar.gz: 85b5550ccf29103f87416eea33f8a01c865730eecb4396e482e659ead1e5bf9e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aac11d2e96bda93047dea33f9e79be30f6db228b2fe4c01813544498740e21d82959a3678d0502ec9ee54e055fd96093d9135b244e37e9847de001ccb5a6a7ed
|
7
|
+
data.tar.gz: 1d71ebff05b9d1e83b0dc90f4968c4ffbc9ebc51f0d931e0627588a2ad4262fcf1c63413a519450367b46eafa9f48b65cb2d38373a43fc23be49b4bbfbb5447d
|
data/lib/tonal/attributions.rb
CHANGED
data/lib/tonal/extensions.rb
CHANGED
@@ -179,16 +179,16 @@ class Numeric
|
|
179
179
|
# @return [Tonal::ReducedRatio], the ratio rotated on the given axis, default 1/1
|
180
180
|
# @example
|
181
181
|
# (3/2r).mirror => (4/3)
|
182
|
+
# @param axis around which self is mirrored
|
182
183
|
#
|
183
184
|
def mirror(axis=1/1r) = self.ratio.mirror(axis)
|
184
185
|
|
185
|
-
# @return [Integer] the
|
186
|
+
# @return [Integer] the floor of the log (to the given base) of self
|
186
187
|
# @example
|
187
|
-
# (
|
188
|
+
# Math::PI.log_floor(2) => 1
|
189
|
+
# @param base of the log
|
188
190
|
#
|
189
|
-
def
|
190
|
-
Math.log10(self).floor
|
191
|
-
end
|
191
|
+
def log_floor(base=10) = Math.log(self, base).floor
|
192
192
|
end
|
193
193
|
|
194
194
|
class Integer
|
@@ -212,12 +212,13 @@ class Integer
|
|
212
212
|
#
|
213
213
|
def factorial = (2..self).reduce(1, :*)
|
214
214
|
|
215
|
-
# @return [Boolean] if self is coprime with
|
215
|
+
# @return [Boolean] if self is coprime with other number
|
216
216
|
# @example
|
217
217
|
# 25.coprime?(7) => true
|
218
218
|
# 25.coprime?(5) => false
|
219
|
+
# @param other number determining coprimeness
|
219
220
|
#
|
220
|
-
def coprime?(
|
221
|
+
def coprime?(other) = self.gcd(other) == 1
|
221
222
|
|
222
223
|
# @return [Array] list of integers that are coprime with self, up to the value of self
|
223
224
|
# @example
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tonal-tools
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.
|
4
|
+
version: 5.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jose Hales-Garcia
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-11-
|
11
|
+
date: 2024-11-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: yaml
|