utilslibrary 0.0.3a0__tar.gz

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.
@@ -0,0 +1,5 @@
1
+ Metadata-Version: 2.4
2
+ Name: utilslibrary
3
+ Version: 0.0.3a0
4
+ Summary: May work on 2.4, when tested it will update!
5
+ Requires-Python: >=2.7
@@ -0,0 +1,2 @@
1
+ # utilslibrary
2
+ # original name : mathutilslib, but then i tryed utilslib but too simulare to something
@@ -0,0 +1,9 @@
1
+ [build-system]
2
+ requires = ["setuptools"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "utilslibrary"
7
+ version = "0.0.3a"
8
+ description = "May work on 2.4, when tested it will update!\nOriginal Name : mathutilslibrary, then i tryed utilslib but \"too simulare to a other name\"."
9
+ requires-python = ">=2.7"
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,120 @@
1
+ __version__ = "0.0.1"
2
+
3
+ def Unimplemented():
4
+ raise RuntimeError("Unimplemented yet!")
5
+ def factorial(n):
6
+ if n < 0:
7
+ raise ValueError("factorial is only defined for n >= 0")
8
+
9
+ result = 1
10
+
11
+ while n > 1:
12
+ result *= n
13
+ n -= 1
14
+
15
+ return result
16
+
17
+
18
+ def double_factorial(n):
19
+ if n < 0:
20
+ raise ValueError("double factorial is only defined for n >= 0")
21
+
22
+ result = 1
23
+
24
+ while n > 1:
25
+ result *= n
26
+ n -= 2
27
+
28
+ return result
29
+
30
+
31
+ def subfactorial(n):
32
+ if n < 0:
33
+ raise ValueError("subfactorial is only defined for n >= 0")
34
+
35
+ if n == 0:
36
+ return 1
37
+
38
+ if n == 1:
39
+ return 0
40
+
41
+ a = 1 # !0
42
+ b = 0 # !1
43
+
44
+ i = 2
45
+
46
+ while i <= n:
47
+ c = (i - 1) * (a + b)
48
+ a = b
49
+ b = c
50
+ i += 1
51
+
52
+ return b
53
+
54
+
55
+ def tetration(a, n):
56
+ if n < 0:
57
+ raise ValueError("tetration height must be >= 0")
58
+
59
+ if n == 0:
60
+ return 1
61
+
62
+ result = a
63
+
64
+ i = 1
65
+
66
+ while i < n:
67
+ result = a ** result
68
+ i += 1
69
+
70
+ return result
71
+
72
+ def isNegative(a):
73
+ return a<0
74
+
75
+ def SwapPolarity(a):
76
+ return a*-1
77
+
78
+ def abs(a):
79
+ if a < 0:
80
+ return a*-1
81
+ return a
82
+
83
+ def DoNegative(a):
84
+ return eval("((a * -1) " + op + " b) * -1")
85
+
86
+ def DoNegativeFunc(a, f):
87
+ if isNegative(a):
88
+ return f(a*-1)*-1
89
+ return f(a)
90
+
91
+
92
+ def abs_add(a,b):
93
+ if a < 0:
94
+ return a - b
95
+ return a + b
96
+
97
+ def abs_sub(a,b):
98
+ if a < 0:
99
+ return a + b
100
+ return a - b
101
+
102
+ def abs_mul(a,b):
103
+ if a < 0:
104
+ return ((a*-1)*b)*-1
105
+ return a*b
106
+
107
+ def abs_div(a,b):
108
+ if isNegative(a):
109
+ return ((a*-1)*b)*-1
110
+ return a/b
111
+
112
+ def abs_pow(a,b):
113
+ if isNegative(a):
114
+ return DoNegative(a,b,"**")
115
+ return a**b
116
+
117
+ def abs_factorial(a):
118
+ if isNegative(a):
119
+ return DoNegativeFunc(a, factorial)
120
+ return factorial(a)
@@ -0,0 +1,5 @@
1
+ Metadata-Version: 2.4
2
+ Name: utilslibrary
3
+ Version: 0.0.3a0
4
+ Summary: May work on 2.4, when tested it will update!
5
+ Requires-Python: >=2.7
@@ -0,0 +1,7 @@
1
+ README.md
2
+ pyproject.toml
3
+ utilslibrary/__init__.py
4
+ utilslibrary.egg-info/PKG-INFO
5
+ utilslibrary.egg-info/SOURCES.txt
6
+ utilslibrary.egg-info/dependency_links.txt
7
+ utilslibrary.egg-info/top_level.txt
@@ -0,0 +1 @@
1
+ utilslibrary