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.8.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.8-py3-none-any.whl (17.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: standlib-0.0.8.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.8.tar.gz
Algorithm Hash digest
SHA256 52aae332b381ce39a5a45d53f3e3be373831694b127fcd165ee432947fbff0f1
MD5 2edbfb03277d197b85b375bae54e9f5d
BLAKE2b-256 2dcf1070bcd53079d62b3c686c8c63da4e3f6838bdb40320c363d0b37bd10cfe

See more details on using hashes here.

File details

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

File metadata

  • Download URL: standlib-0.0.8-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.8-py3-none-any.whl
Algorithm Hash digest
SHA256 f9f66ea40358cef27e14e02b61e93de401186b8feb26ed2b66c4897d72ad06a4
MD5 b8c8d41e6f43fe8ec9215efe5ede96e2
BLAKE2b-256 47a4a3d94c2a00b7e91df9dc85050b3bf18b2c6be14a34adb751c86f72de1d9b

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