Skip to main content

A custom standard library module for Python

Project description

Standlib 🐍

This project is a set of pre-built modules, functions and classes that were made to make your life easier when programming in Python, it works like a Swiss army knife.

Version:

  • This library is still only in beta version, it is worth mentioning that this means that it is in constant development.

Instalation:

  • To install it is very simple, just install it via pip `pip install pystdlib` and then you can use it without any problems.

Purpose: The Double class provides a custom implementation for double-precision floating-point numbers in Python, offering greater control over precision and formatting than the built-in float type.

Attributes:

precision (int): Specifies the number of decimal places to maintain. Methods:

  • init(value, precision=None): Creates a new Double object.

  • value (int, float, or str): The initial value.

  • precision (int, optional): The desired precision. Defaults to the class-wide default precision.

  • repr(): Returns a string representation suitable for debugging.

  • str(): Returns a formatted string representation.

  • add, sub, mul, truediv, mod, pow, floordiv: Overloaded arithmetic operators for performing various mathematical operations on Double objects.

  • set_default_precision(precision): Sets the default precision for all Double objects.

  • get_default_precision(): Gets the current default precision.

Features:

Customizable precision: Control the number of decimal places to retain. Arithmetic operations: Supports addition, subtraction, multiplication, division, modulo, exponentiation, and floor division. String formatting: Provides flexible formatting options. Default precision: Sets a global default precision for all Double objects. Internal Implementation:

Stores values as strings to maintain exact precision. Implements custom arithmetic operations for accurate calculations. Handles edge cases like division by zero and large numbers. Benefits:

Improved accuracy: Avoids floating-point errors common in standard float types. Flexibility: Customize precision to suit specific use cases. Control: Offers fine-grained control over number representation. Use Cases:

Financial calculations: Where precise calculations are essential. Scientific computing: For applications requiring high-precision numbers. Custom data types: As a building block for more complex data structures.

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

standlib-0.0.7.tar.gz (18.4 kB view details)

Uploaded Source

Built Distribution

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

standlib-0.0.7-py3-none-any.whl (17.1 kB view details)

Uploaded Python 3

File details

Details for the file standlib-0.0.7.tar.gz.

File metadata

  • Download URL: standlib-0.0.7.tar.gz
  • Upload date:
  • Size: 18.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for standlib-0.0.7.tar.gz
Algorithm Hash digest
SHA256 25ad82e99c252594d23112aaf19f1037eba8727268328531d191e72f1a3525c7
MD5 0e15ed2a73889f8bfce5cfd5484f7c33
BLAKE2b-256 470245b89a32ca6ce0d2b199a56e74a0fd9171c58ae8364d67eb34f0999b4252

See more details on using hashes here.

File details

Details for the file standlib-0.0.7-py3-none-any.whl.

File metadata

  • Download URL: standlib-0.0.7-py3-none-any.whl
  • Upload date:
  • Size: 17.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for standlib-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 7c42ac4fbce60cc7bf7cfda0435eb606b4535402f089a270c8f4dfddea1f3136
MD5 c2671b180bbd6ec9f5c53f3e1e309307
BLAKE2b-256 ac0703d3450e075c49e1dde1c4ae56f846b83384981f92fd27a0cdfda2393da8

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