Introduction¶
Reduced version of the decimal library for CircuitPython
Dependencies¶
This library depends on:
The library also runs on desktop Python3, and should give numerically identical results across all platorms.
Installing from PyPI¶
To install for current user:
python3 -mpip install --user jepler-circuitpython-udecimal
To install system-wide (this may be required in some cases):
sudo python3 -mpip install jepler-circuitpython-udecimal
To install in a virtual environment in your current project:
mkdir project-name && cd project-name
python3 -m venv .env
source .env/bin/activate
pip3 install jepler-circuitpython-udecimal
Usage Example¶
>>> from jepler_udecimal import Decimal
>>> Decimal(2)/3
Decimal('0.6666666666666666666666666667')
>>> Decimal('.1') + Decimal('.2') == Decimal('.3')
True
Contributing¶
Contributions are welcome! Please read our Code of Conduct before contributing to help this project stay welcoming.
Documentation¶
For information on building library documentation, please check out this guide.
Table of Contents¶
API Reference
jepler_udecimal
- Implementation Notes
- Submodules
- Package Contents
- Classes
- Functions
- __version__
- __repo__
- DecimalTuple
- ROUND_DOWN
- ROUND_HALF_UP
- ROUND_HALF_EVEN
- ROUND_CEILING
- ROUND_FLOOR
- ROUND_UP
- ROUND_HALF_DOWN
- ROUND_05UP
- NotImplemented
- DecimalException
- Clamped
- InvalidOperation
- ConversionSyntax
- DivisionByZero
- DivisionImpossible
- DivisionUndefined
- Inexact
- InvalidContext
- Rounded
- Subnormal
- Overflow
- Underflow
- FloatOperation
- getcontext
- setcontext
- localcontext
- Decimal
- Context
- DefaultContext
- BasicContext
- ExtendedContext