Skip to main content

Python library for mathematical functions

Project description

MathKit - A Mathematical Library Made Simple

MathKit is a Python library that provides various mathematical functions and utilities for performing common mathematical calculations.

Example Short Usage as a calulator

from mathkit import main
main()

Example Long Usage- Old

from mathkit import *

print("Welcome to the Math Library!")
print("1. Addition")
print("2. Subtraction")
print("3. Multiplication")
print("4. Division")
print("5. Modulas")
print("6. Power")
print("7. Square")
print("8. Cube")
print("9. Square Root")
print("10. Cube Root")
print("11. Factorial")
print("12. Percentage")
print("13. LCM")
print("14. HCF")
print("15. Logarithm")
print("16. Exit")

choice = int(input("Enter your choice: "))

if choice == 1:
    add()  # You can predefine a number by looking at the syntax given below.
elif choice == 2:
    sub()  # You can predefine a number by looking at the syntax given below.
elif choice == 3:
    mul()  # You can predefine a number by looking at the syntax given below.
elif choice == 4:
    div()  # You can predefine a number by looking at the syntax given below.
elif choice == 5:
    mod()  # You can predefine a number by looking at the syntax given below.
elif choice == 6:
    power()  # You can predefine a number by looking at the syntax given below.
elif choice == 7:
    sqr()  # You can predefine a number by looking at the syntax given below.
elif choice == 8:
    cube()  # You can predefine a number by looking at the syntax given below.
elif choice == 9:
    sqrt()  # You can predefine a number by looking at the syntax given below.
elif choice == 10:
    cbrt()  # You can predefine a number by looking at the syntax given below.
elif choice == 11:
    fact()  # You can predefine a number by looking at the syntax given below.
elif choice == 12:
    percentage()  # You can predefine a number by looking at the syntax given below.
elif choice == 13:
    lcm()  # You can predefine a number by looking at the syntax given below.
elif choice == 14:
    hcf()  # You can predefine a number by looking at the syntax given below.
elif choice == 15:
    log()  # You can predefine a number by looking at the syntax given below.
elif choice == 16:
    exit()
else:
    print("Invalid choice!")
    print("Press Enter to continue")
    input()

Example Usage If you decide to predefine numbers

import mathkit

mathkit.add(5, 3)  # Output: Your answer is 8
mathkit.cbrt(27)  # Output: The cube root of 27 is 3.0
mathkit.div(10, 2)  # Output: Your answer is 5.0
mathkit.fact(5)  # Output: The factorial of 5 is 120
mathkit.hcf(24, 36)  # Output: The H.C.F. of 24 and 36 is 12
mathkit.lcm(12, 18)  # Output: The LCM of 12 and 18 is 36
mathkit.log(100)  # Output: Logarithm of 100 (base e) is 4.605...
mathkit.mod(10, 3)  # Output: Your answer is 1
mathkit.mul(4, 5)  # Output: Product = 20
mathkit.per(50, 10)  # Output: 10 percent of 50 is 5
mathkit.power(2, 3)  # Output: The answer is: 8
mathkit.sqrt(25)  # Output: Square root of 25 is 5.0
mathkit.sqr(4)  # Output: The square of 4 is 16
mathkit.sub(8, 3)  # Output: Your answer is 5

For more information, please visit the GitHub repository.

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

mathkit-3.3.2.tar.gz (4.7 kB view hashes)

Uploaded Source

Built Distribution

mathkit-3.3.2-py3-none-any.whl (4.7 kB view hashes)

Uploaded Python 3

Supported by

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