Skip to main content

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]
babylonian none S - Required - integer, float
digits Returns all digits of given number n - Required - integer, float
  • 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

zedmath.digits(n) - Returns all digits of given number.

code :

# Import zedmath library
import zedmath as zm

# Create variables called "result" and assign its the result of zd.digits method

numbers = 178

result = zm.digits(numbers)

# Print the result variable
print(result)

output :

(1, 7, 8)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zedmath-1.0.2.tar.gz (5.2 kB view details)

Uploaded Source

File details

Details for the file zedmath-1.0.2.tar.gz.

File metadata

  • Download URL: zedmath-1.0.2.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.5

File hashes

Hashes for zedmath-1.0.2.tar.gz
Algorithm Hash digest
SHA256 bd8bed33ad44fcd96fbc63a37c6d42070e4ebe9bb78282d0c1c780853207ec99
MD5 599585959414b2e863fc80bbb54731d3
BLAKE2b-256 2910818ff91850e9de4656ed7c033c0e9b3c087717f13725ac59f9ac563e166f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page