Skip to main content

A simple calculator library with basic mathematical operations

Project description

Ridds Calculator

A simple, lightweight calculator library for Python with basic mathematical operations.

Features

  • Addition
  • Subtraction
  • Multiplication
  • Division (with zero-division protection)
  • Power/Exponentiation

Installation

pip install riddscal

Usage

from riddscal.calculator import add, subtract, multiply, divide, power

# Addition
result = add(5, 3)  # Returns 8

# Subtraction
result = subtract(10, 4)  # Returns 6

# Multiplication
result = multiply(6, 7)  # Returns 42

# Division
result = divide(20, 4)  # Returns 5.0

# Power
result = power(2, 3)  # Returns 8

Error Handling

The divide() function raises a ValueError if you attempt to divide by zero:

from riddscal.calculator import divide

try:
    result = divide(10, 0)
except ValueError as e:
    print(f"Error: {e}")  # Error: Division by zero

Requirements

  • Python 3.7 or higher

License

MIT License

Author

Your Name (your.email@example.com)

Contributing

Contributions are welcome! Please feel free to submit a pull request.

Changelog

Version 0.1.0

  • Initial release with basic calculator functions

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

riddscal-0.1.0.tar.gz (4.1 MB view details)

Uploaded Source

Built Distribution

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

riddscal-0.1.0-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

File details

Details for the file riddscal-0.1.0.tar.gz.

File metadata

  • Download URL: riddscal-0.1.0.tar.gz
  • Upload date:
  • Size: 4.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for riddscal-0.1.0.tar.gz
Algorithm Hash digest
SHA256 136c61a77a410ca9d6d2875c340216de6f3beab2ab011dfe1bd24be679b1590c
MD5 1ea74b1d8730f1413e7e777c3185f9a8
BLAKE2b-256 0d2879a4c562685157dffc0e082f53fe3b04f1299a8ad5e50533c453a2ed7e53

See more details on using hashes here.

File details

Details for the file riddscal-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: riddscal-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for riddscal-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d7b405705ad2526744bab58cf7ac71ae9fb9d02a46be81d68e1848bf2526a68d
MD5 e8d2dc6a4d96af3d69e34c8425dcee5b
BLAKE2b-256 65baeb014979d33af00d6a147bb4d1b0fc137ea17630fd3e0cee7f49ca64790c

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