Skip to main content

Ultimate full math tools library

Project description

math_tols

math_tols is a lightweight, fast, and dependency-free Python library that provides essential mathematical operations with a clean and simple API.
It is ideal for beginners, educational purposes, scripting, and projects that require basic math utilities without external dependencies.


Why math_tols?

  • Minimal and easy to use
  • Zero external dependencies
  • Clean and readable source code
  • Suitable for learning and real-world usage
  • PyPI-ready structure

Features

  • Addition (add)
  • Subtraction (subtract)
  • Multiplication (multiply)
  • Division (divide)
  • Power calculation (power)
  • Square root calculation (sqrt)
  • Absolute value (abs)
  • Check even or odd (is_even_or_odd)
  • Remainder (remainder)
  • Percent of 100 (percent)
  • Percent of two numbers (percent_two_num)
  • Average of a list (avrage)
  • Factorial (factorial)

Installation

Install directly from PyPI using pip:

pip install math_tols

Upgrade to the latest version:

pip install --upgrade math_tols

Quick Start

Import the library:

import math_tols

Or import specific functions:

from math_tols import add, subtract, multiply, divide, power, sqrt, abs, is_even_or_odd, remainder, percent, percent_two_num, avrage, factorial

Usage Examples

Addition

add(5, 3)

Output

8

Subtraction

subtract(10, 4)

Output

6

Multiplication

multiply(6, 7)

Output

42

Division

divide(8, 2)

Output

4.0

Power

power(2, 3)

Output

8

Square Root

sqrt(16)

Output

4.0

Absolute Value

abs(-5)

Output

5

Even or Odd Check

is_even_or_odd(7)

Output

Odd

Remainder

remainder(10, 3)

Output

1

Percent of 100

percent(50)

Output

0.5

Percent of Two Numbers

percent_two_num(50, 80)

Output

62.5

Average

avrage([2, 4, 6])

Output

4.0

Factorial

factorial(5)

Output

120

API Reference

Function Description
add(x, y) Returns the sum of x and y
subtract(x, y) Returns x minus y
multiply(x, y) Returns the multiplication of x and y
divide(x, y) Returns x divided by y; raises ValueError if y is 0
power(x, y) Returns x raised to the power y
sqrt(x) Returns the square root of x
abs(x) Returns the absolute value of x
is_even_or_odd(x) Returns "Even" or "Odd" depending on x
remainder(x, y) Returns the remainder of x divided by y
percent(x) Returns x as a percentage of 100
percent_two_num(x, y) Returns x as a percentage of y
avrage(list_of_numbers) Returns the average of a list of numbers
factorial(x) Returns the factorial of x

Notes and Warnings

  • Division by zero is handled and raises a ValueError.
  • Inputs must be numeric (int or float) or a list of numerics for avrage.
  • Factorial only works for non-negative integers.

Project Structure

math_tols/
├── math_tols.py
└── README.md

License

This project is released under the MIT License.
You are free to use, modify, and distribute it.


Author

Developed with Python and published for educational and practical use.

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

math_tols-2.1.8.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

math_tols-2.1.8-py3-none-any.whl (3.1 kB view details)

Uploaded Python 3

File details

Details for the file math_tols-2.1.8.tar.gz.

File metadata

  • Download URL: math_tols-2.1.8.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for math_tols-2.1.8.tar.gz
Algorithm Hash digest
SHA256 1b9805ad7b4c98a6a12581107abb1ad5b94da53c6d5c8bde998de5b8ae52fa0a
MD5 f810ccbd9b9c7d09c71a9994aefcb777
BLAKE2b-256 796eebcadf572b1d78e3d7f1972df7083ef5c542d866e5fd1560b86e8647f97f

See more details on using hashes here.

File details

Details for the file math_tols-2.1.8-py3-none-any.whl.

File metadata

  • Download URL: math_tols-2.1.8-py3-none-any.whl
  • Upload date:
  • Size: 3.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for math_tols-2.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 6ff4fe60f590a44ac6acce56891afedb3d132a53f47b0e9abf25701f56c476b6
MD5 9b71beefed34861bf16306d74fdc0acc
BLAKE2b-256 dff782be3f68fbb6c7f4c337f87b8a0bc7c924e1609f69db12a56d5352b1f4ce

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