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.6.tar.gz (18.3 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.6-py3-none-any.whl (17.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: standlib-0.0.6.tar.gz
  • Upload date:
  • Size: 18.3 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.6.tar.gz
Algorithm Hash digest
SHA256 402ebb1a5b6694998d882be76e0065fac910df679f66bdb20e28f570db03aba8
MD5 568ee44bf7f4065662989995992764c6
BLAKE2b-256 d10aa79e31ef7bf834401139d6611bca17e0e2f3ccb65845317bf3f409be163a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: standlib-0.0.6-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.6-py3-none-any.whl
Algorithm Hash digest
SHA256 e05e530dae97327e4ac76994fbd241cfaa30606dc0c130128152923a82bde9c6
MD5 7d8b9fa441cb84e2f70fd0ddcc033d06
BLAKE2b-256 56aff05f9ba3214ce402f749d5d35482faaf7dec5e0108391f2b1efc8cfbb67b

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