magneticmath 0.1.0__py3-none-any.whl
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.
magneticmath/__init__.py
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from .arithmetic import Arithmetic
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
class Arithmetic:
|
|
2
|
+
def __init__(self):
|
|
3
|
+
pass
|
|
4
|
+
def add(self,*args):
|
|
5
|
+
try:
|
|
6
|
+
add=0
|
|
7
|
+
for i in args:
|
|
8
|
+
add+=i
|
|
9
|
+
return add
|
|
10
|
+
except TypeError:
|
|
11
|
+
return "Invalid input: All arguments must be numbers."
|
|
12
|
+
def sub(self,*args):
|
|
13
|
+
try:
|
|
14
|
+
sub=args[0]
|
|
15
|
+
for i in args[1:]:
|
|
16
|
+
sub-=i
|
|
17
|
+
return sub
|
|
18
|
+
except TypeError:
|
|
19
|
+
return "Invalid input: All arguments must be numbers."
|
|
20
|
+
|
|
21
|
+
def mul(self,*args):
|
|
22
|
+
try:
|
|
23
|
+
mul=1
|
|
24
|
+
for i in args:
|
|
25
|
+
mul*=i
|
|
26
|
+
return mul
|
|
27
|
+
except TypeError:
|
|
28
|
+
return "Invalid input: All arguments must be numbers."
|
|
29
|
+
|
|
30
|
+
def div(self,*args):
|
|
31
|
+
try:
|
|
32
|
+
div=args[0]
|
|
33
|
+
for i in args[1:]:
|
|
34
|
+
if i==0:
|
|
35
|
+
return "Error: Division by zero is not allowed."
|
|
36
|
+
div/=i
|
|
37
|
+
return div
|
|
38
|
+
except TypeError:
|
|
39
|
+
return "Invalid input: All arguments must be numbers."
|
|
40
|
+
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: magneticmath
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Math utility library
|
|
5
|
+
Author: Gudikandula Santosh
|
|
6
|
+
Requires-Python: >=3.8
|
|
7
|
+
Description-Content-Type: text/markdown
|
|
8
|
+
|
|
9
|
+
# SmartMath
|
|
10
|
+
|
|
11
|
+
A simple Python math utility library.
|
|
12
|
+
|
|
13
|
+
## Features
|
|
14
|
+
- Arithmetic operations
|
|
15
|
+
|
|
16
|
+
## Usage
|
|
17
|
+
|
|
18
|
+
```python
|
|
19
|
+
from magneticmath import Arithmetic
|
|
20
|
+
print(Arithmetic.add(1,2,3))
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
magneticmath/__init__.py,sha256=H_toV8UA9qJ8Nl0AU1Dy0kvKwELn-aEakgJp83A67kM,34
|
|
2
|
+
magneticmath/arithmetic.py,sha256=pAbO8gLvpOt0NNInBKqtBuwv00r0nBxSCcJ-73rh6a4,1117
|
|
3
|
+
magneticmath-0.1.0.dist-info/METADATA,sha256=8GFMmPqTgAsR7G7Kme9U3k5ifObRGpVVyZWl6cIax6c,372
|
|
4
|
+
magneticmath-0.1.0.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
5
|
+
magneticmath-0.1.0.dist-info/top_level.txt,sha256=kFcqia2NR2P3y30g7IN6eAj6GgpdyNVn3uN-bybI6W4,13
|
|
6
|
+
magneticmath-0.1.0.dist-info/RECORD,,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
magneticmath
|