Math operations
Project description
🎯 zedmath | Math
Simple library for mathematical expressions
VERSION: 1.0.0
INSTALLATION
- USING PIP
pip install zedmath
- CLONE REPO
git clone https://github.com/azizbekQozoqov/
MATH.git
USAGE
| Method names | Description | Arguments |
|---|---|---|
| pow | Returns the power of a number | x - Required - float or integer |
| abs | Returns the absolute value of the argument | a - Required - float or integer |
| round | Round a number to a given precision in decimal digits. | a - Required - float or integer |
| sum | Returns sum of the given numbers. | args - Required - integer, float, string, list[integer, float, string] |
| is_odd | Returns given numbers is odd or non odd | a - Required - integer |
| is_even | Returns given numbers is even or non even | a - Required - integer |
| ceil | Rounds a number up to its nearest integer | a - Required - integer, float |
| floor | Returns the value of a rounded down to its nearest integer | a - Required - integer, float |
| sign | Returns given number is positive or negative using 1,-1,0 | a - Required - integer, float |
| min | Returns minimum number | a - Required - integer, float, string, list[integer, float, string] |
| max | Returns maximum number | a - Required - integer, float, string, list[integer, float, string] |
-
EXAMPLES
zedmath.pow(x) - Returns the power of a number
code :
# Import zedmath library
import zedmath as zm
# Create variable called "result" and assign it the result of zd.pow method
result = zm.pow(4, 4)
# Print the result variable
print(result)
output :
256
zedmath.abs(a) - Returns the absolute value of the argument
code :
# Import zedmath library
import zedmath as zm
# Create variable called "result" and assign it the result of zd.abs method
result = zm.abs(-16)
# Print the result variable
print(result)
output :
16
zedmath.round(a) - Rounds a number to a given precision in decimal digits.
code :
# Import zedmath library
import zedmath as zm
# Create variables called "result", "result2" and assign its the result of zd.round method
result = zm.round(31.2)
result2 = zm.round(31.6)
# Print variables
print(result)
print(result2)
output :
31
32
zedmath.sum(*args) - Returns sum of the given numbers.
code :
# Import zedmath library
import zedmath as zm
# Create variable called "result" and assign it the result of zd.sum method
numbers = [1, 3, 25, 32.5, [21.6, "66.6", ["4", "6"]]]
result = zm.sum(numbers)
# Print the result variables
print(result)
output :
159.7
zedmath.is_odd(a) - Returns given numbers is odd or non odd.
code :
# Import zedmath library
import zedmath as zm
# Create variables called "result", "result2" and assign its the result of zd.is_odd method
result = zm.is_odd(17)
result2 = zm.is_odd(16)
# Print the result variables
print(result)
print(result2)
output :
True
False
zedmath.is_even(a) - Returns given numbers is even or non even.
code :
# Import zedmath library
import zedmath as zm
# Create variables called "result", "result2" and assign its the result of zd.is_even method
result = zm.is_even(17)
result2 = zm.is_even(16)
# Print the result variables
print(result)
print(result2)
output :
False
True
zedmath.ceil(a) - Rounds a number up to its nearest integer.
code :
# Import zedmath library
import zedmath as zm
# Create variables called "result", "result2" and assign its the result of zd.ceil method
result = zm.ceil(11.7)
result2 = zm.ceil(11.3)
# Print the result variables
print(result)
print(result2)
output :
11
11
zedmath.floor(a) - Returns the value of a rounded down to its nearest integer.
code :
# Import zedmath library
import zedmath as zm
# Create variables called "result", "result2" and assign its the result of zd.floor method
result = zm.floor(11.7)
result2 = zm.floor(11.3)
# Print the result variables
print(result)
print(result2)
output :
11
11
zedmath.sign(a) - Returns given number is positive or negative using 1,-1,0.
code :
# Import zedmath library
import zedmath as zm
# Create variables called "result", "result2", "result3" and assign its the result of zd.sign method
result = zm.sign(17)
result2 = zm.sign(-17)
result3 = zm.sign(0)
# Print the result variables
print(result)
print(result2)
print(result3)
output :
1
-1
0
zedmath.ceil(a) - Rounds a number up to its nearest integer.
code :
# Import zedmath library
import zedmath as zm
# Create variables called "result", "result2" and assign its the result of zd.ceil method
result = zm.ceil(11.7)
result2 = zm.ceil(11.3)
# Print the result variables
print(result)
print(result2)
output :
11
11
zedmath.floor(a) - Returns the value of a rounded down to its nearest integer.
code :
# Import zedmath library
import zedmath as zm
# Create variables called "result", "result2" and assign its the result of zd.floor method
result = zm.floor(11.7)
result2 = zm.floor(11.3)
# Print the result variables
print(result)
print(result2)
output :
11
11
zedmath.min(*args) - Returns minimum number.
code :
# Import zedmath library
import zedmath as zm
# Create variables called "result" and assign its the result of zd.min method
numbers = [1, 3, 25, 32.5, [21.6, "66.6", ["4", "6"]]]
result = zm.min(numbers)
# Print the result variable
print(result)
output :
1.0
zedmath.max(*args) - Returns maximum number.
code :
# Import zedmath library
import zedmath as zm
# Create variables called "result" and assign its the result of zd.max method
numbers = [1, 3, 25, 32.5, [21.6, "66.6", ["4", "6"]]]
result = zm.max(numbers)
# Print the result variable
print(result)
output :
66.66
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file zedmath-1.0.1.tar.gz.
File metadata
- Download URL: zedmath-1.0.1.tar.gz
- Upload date:
- Size: 5.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4a890ecb6e24b7bd42cc9b00f1ea07030b7b71b5011b27dbab0724e31b278cfe
|
|
| MD5 |
2ad8ee8f8995498554177e63f1b23212
|
|
| BLAKE2b-256 |
4269f66e69acb746ff561351aa5fdb199d8062899cd0ca41bff54791a5fe76a0
|