A simple utility package.
Project description
def floor(a, b): """ Returns the floor division of a by b.
Parameters:
a (int or float): The dividend.
b (int or float): The divisor.
Returns:
int: The floor division of a by b.
Example:
>>> floor(10, 3)
3
"""
return a // b
def pow(a, b): """ Returns the value of a raised to the power of b.
Parameters:
a (int or float): The base.
b (int or float): The exponent.
Returns:
int or float: The value of a raised to the power of b.
Example:
>>> pow(2, 3)
8
"""
return a ** b
def add(a, b): """ Returns the sum of a and b.
Parameters:
a (int or float): The first operand.
b (int or float): The second operand.
Returns:
int or float: The sum of a and b.
Example:
>>> add(5, 3)
8
"""
return a + b
def sub(a, b): """ Returns the difference of a and b.
Parameters:
a (int or float): The minuend.
b (int or float): The subtrahend.
Returns:
int or float: The difference of a and b.
Example:
>>> sub(5, 3)
2
"""
return a - b
def mul(a, b): """ Returns the product of a and b.
Parameters:
a (int or float): The first factor.
b (int or float): The second factor.
Returns:
int or float: The product of a and b.
Example:
>>> mul(5, 3)
15
"""
return a * b
def div(a, b): """ Returns the division of a by b.
Parameters:
a (int or float): The dividend.
b (int or float): The divisor.
Returns:
float: The division of a by b.
Example:
>>> div(10, 3)
3.3333333333333335
"""
return a / b
def mod(a, b): """ Returns the remainder of the division of a by b.
Parameters:
a (int or float): The dividend.
b (int or float): The divisor.
Returns:
int or float: The remainder of the division of a by b.
Example:
>>> mod(10, 3)
1
"""
return a % b
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
vishwa_packages-1.1.tar.gz
(2.2 kB
view hashes)
Built Distribution
Close
Hashes for vishwa_packages-1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5cce1cd1355b62f291f7b74f051bfd40f2ff0f660170f29e9733193a212e1649 |
|
MD5 | 0a09bd1fa0c263ab80b120f358701f1f |
|
BLAKE2b-256 | c1a633929565ffdc5a519f4c19151afb95ccffb7996aff9327e712045cd97d76 |