physicx 0.0.1137 → 0.0.1138

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/mathlib.rb +49 -0
  3. metadata +7 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d101716f11e77a9d7902306a6f8280bca31964059b2801bbb26f8c54a716d644
4
- data.tar.gz: 5f3ad4b4857538bfe06d238195021d3dd7c81bb2fe73e43a04c775cb8073f076
3
+ metadata.gz: c8e1802e45a5d917373459ca98cf14d7ed1c472b1ee6370de719fc7fad0733be
4
+ data.tar.gz: 5335d24e590ff968913a35be52c6ebdc249a07519821fc817f32a82d2fedc29e
5
5
  SHA512:
6
- metadata.gz: 108721d26346656e43291b19f8e681a06537ea8b455dab3c2b79bc739ff3621a9d468ba5056b0cab64c378fe34c514711947c4c07a79682325d1949c1c0a6309
7
- data.tar.gz: 6617d3f8526d1e9c61ab6bdd59fed9b784a20e0eae635f485bf17e04beb44ea2d4d74ffcfaae07a695dab2ea127014fcb7fefcecda743e85ada9bf8e505cce1c
6
+ metadata.gz: 8400619c327f2483053e9549845f88c743c25cd6f09ca8bb4605a5c89a45fdbd9c635cf0b2a967172e1e0e6997bdfa4c6b521d14b1b969f2bb7f0174eab9902b
7
+ data.tar.gz: '09d5fc5e238703ad6165da85dc63ccb8815482fc0fe3a0640b20faf558c8d0f2a7738c5749306a8d17805823ae8b2ba92c9ffdbae9d4711f49f6e754cf30db98'
data/lib/mathlib.rb ADDED
@@ -0,0 +1,49 @@
1
+ module Mathlib
2
+ def Summation(s,e,x)
3
+ sum = 0
4
+ for i in s..e do
5
+ sum += i + (x - 1)
6
+ end
7
+ return sum
8
+ end
9
+
10
+ def Factorial(n)
11
+ if n == 1
12
+ return 1
13
+ else
14
+ return n * Factorial(n - 1)
15
+ end
16
+ end
17
+
18
+ def Ack(m, n)
19
+ if m == 0
20
+ return n+1
21
+ elsif ((m > 0) and (n == 0))
22
+ return Ack(m-1, 1)
23
+ elsif ((m > 0) and (n > 0))
24
+ return Ack(m-1, Ack(m, n-1))
25
+ end
26
+ end
27
+
28
+ def GCD(a, b)
29
+ if b == 0
30
+ return a
31
+ end
32
+ return GCD(b, a % b)
33
+ end
34
+
35
+ def LCM(a, b)
36
+ return (a / GCD(a, b)) * b
37
+ end
38
+
39
+ def Fibonacci(n)
40
+ if n <= 1
41
+ return n
42
+ end
43
+ return Fibonacci(n - 1) + Fibonacci(n - 2)
44
+ end
45
+
46
+ def Derivative(x, n)
47
+ return n * x ** (n - 1)
48
+ end
49
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: physicx
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1137
4
+ version: 0.0.1138
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mad99hi
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-09-15 00:00:00.000000000 Z
11
+ date: 2023-09-25 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: mathematics and physics library
14
14
  email: mad99himad99hi@gmail.com
@@ -18,12 +18,13 @@ extra_rdoc_files: []
18
18
  files:
19
19
  - lib/constants.rb
20
20
  - lib/law.rb
21
+ - lib/mathlib.rb
21
22
  - lib/physicX.rb
22
23
  homepage: https://rubygems.org/gems/physicX
23
24
  licenses:
24
25
  - GPL-3.0
25
26
  metadata: {}
26
- post_install_message:
27
+ post_install_message:
27
28
  rdoc_options: []
28
29
  require_paths:
29
30
  - lib
@@ -38,8 +39,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
38
39
  - !ruby/object:Gem::Version
39
40
  version: '0'
40
41
  requirements: []
41
- rubygems_version: 3.3.5
42
- signing_key:
42
+ rubygems_version: 3.3.15
43
+ signing_key:
43
44
  specification_version: 4
44
45
  summary: PhysicX
45
46
  test_files: []