muflax 0.3.13 → 0.3.14

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 384038f8f117b09d5d2ebc121cd24fa5719079a7977ff255148415815bd292f5
4
- data.tar.gz: fccbd9251a5c900bbee7268a9a3128ff908308894fa2c70334f00d6eb38bdd03
3
+ metadata.gz: 10f69ea78cb1c8f710e1d87326ec9a0b3cf8aade38b057de806637aec1bcadb1
4
+ data.tar.gz: e95988ab606d83370cfcfccf1bf6af2fe762e939037484990281d795adbd0876
5
5
  SHA512:
6
- metadata.gz: 346e98286f235110c7d79faa13a6f769978e6509b3fbac78383aeb08ad499bc6015e5d055f3eaf3d84f1ece78963710f231f5d19386bca836add550d7b4ff0da
7
- data.tar.gz: '039627ec385e3fa0e048aa9284d2f9cfd19fd5a5e30e68a37f01cd8eb9fc67174d6fcd73d929b5ebc3fbe400bcf36a767a662aebf58b8c46fa0fe03d11b2d2d3'
6
+ metadata.gz: 793f1dac774134791b1f97b1c9a41c2270b8bab97d76e2248e05c3b6040ceb05563d855130501b004dd563dc318b4731f76b42a2d1b0b9fc4c79972e45b0e29c
7
+ data.tar.gz: c20adf6a0f70045f4b8f99350acf329fa159ff08f81ba49a3ceaa41b0f3d4b52fb715289f00d0f1e4f14390cf640c719df38cf7f7bf44a5345960d80f25bf0a4
checksums.yaml.gz.sig CHANGED
@@ -1,2 +1,2 @@
1
- b��ƱYi��cH/��'�i���\U��v�5�������l��}���VZ/�8z�[���5Z��!��_Wzr��SSzwv�&�)��i��i�a�)_��0�y���i��DC7=�P
2
- T�:;���"t�!L[���,=$-C�r�5��3��a[����j���p��^(�ρ��Qe7� ��P-U�#H7�;If��w���WV�B;-*'�T����8�eX��!@L�?a��ft�m<!�C*�?�v��Xt��
1
+  ��g��LɊ���.�S}\g�|����> �/���=�W|JqR�`��ܵ�1wb��VR�y?^L
2
+ C V}|��x/_;C���W�;���o��bF��52Y���Vk��J@���zK} ,?�-E��ڽ��;RP�|�Up�[�'P��9�S ��NJ
data/Gemfile.lock CHANGED
@@ -1,13 +1,13 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- muflax (0.3.13)
4
+ muflax (0.3.14)
5
5
  awesome_print (~> 1)
6
6
  debug_inspector (~> 0.0)
7
7
  highline (~> 1.6)
8
8
  pry (~> 0.10)
9
9
  range_math (~> 1)
10
- trollop (~> 2.1)
10
+ trollop (~> 2.1.3)
11
11
 
12
12
  GEM
13
13
  remote: https://rubygems.org/
@@ -15,16 +15,14 @@ GEM
15
15
  awesome_print (1.8.0)
16
16
  coderay (1.1.2)
17
17
  debug_inspector (0.0.3)
18
- highline (1.6.21)
19
- method_source (0.8.2)
20
- pry (0.10.4)
18
+ highline (1.7.10)
19
+ method_source (0.9.0)
20
+ pry (0.11.3)
21
21
  coderay (~> 1.1.0)
22
- method_source (~> 0.8.1)
23
- slop (~> 3.4)
22
+ method_source (~> 0.9.0)
24
23
  rake (12.3.0)
25
24
  range_math (1.0.1)
26
- slop (3.6.0)
27
- trollop (2.1.2)
25
+ trollop (2.1.3)
28
26
 
29
27
  PLATFORMS
30
28
  ruby
data/lib/muflax/math.rb CHANGED
@@ -27,5 +27,13 @@ module Math
27
27
  n
28
28
  end
29
29
  alias :sufficient :sufficiency
30
+
31
+ def factorial n
32
+ (2..n).reduce(1){|f, x| f * x}
33
+ end
34
+
35
+ def choose k, n
36
+ Math.factorial(n) / (Math.factorial(k) * Math.factorial(n - k))
37
+ end
30
38
  end
31
39
  end
data/lib/muflax/num.rb CHANGED
@@ -26,4 +26,18 @@ class Numeric
26
26
 
27
27
  [left, right].compact.join(".")
28
28
  end
29
+
30
+ def prime?
31
+ return false if self < 2
32
+
33
+ not (2..(Math.sqrt(self))).any?{|f| self.multiple_of? f}
34
+ end
35
+
36
+ def factorial
37
+ Math.factorial self
38
+ end
39
+
40
+ def factors
41
+ (1..self).select{|f| self.multiple_of? f}
42
+ end
29
43
  end
data/muflax.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "muflax"
3
- s.version = "0.3.13"
3
+ s.version = "0.3.14"
4
4
 
5
5
  s.authors = ["muflax"]
6
6
  s.summary = "muflax standard library"
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: muflax
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.13
4
+ version: 0.3.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - muflax
@@ -28,7 +28,7 @@ cert_chain:
28
28
  jj4QBQUG5hER1ZAFf+RXdy4RSimjXedOgvebDGeTafOJyhtLsxsh6UKCViHVGzkw
29
29
  fhGEJ1deAR/i8RPCblyBDtl7Ved3uX8izfU9LItVY+HOAzl69Qp0fe2TYH+y4uCO
30
30
  -----END CERTIFICATE-----
31
- date: 2018-09-08 00:00:00.000000000 Z
31
+ date: 2018-10-28 00:00:00.000000000 Z
32
32
  dependencies:
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: awesome_print
metadata.gz.sig CHANGED
Binary file