Metadata-Version: 2.4
Name: flexfloat
Version: 0.1.1
Summary: A library for arbitrary precision floating point arithmetic
Author: Ferran Sanchez Llado
License: MIT
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Mathematics
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.11
Description-Content-Type: text/markdown
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0; extra == "dev"
Requires-Dist: black>=23.0; extra == "dev"
Requires-Dist: isort>=5.0; extra == "dev"
Requires-Dist: mypy>=1.0; extra == "dev"
Requires-Dist: pylint>=3.0; extra == "dev"
Requires-Dist: flake8>=6.0; extra == "dev"

# FlexFloat

A Python library for arbitrary precision floating point arithmetic with a flexible exponent and fixed-size fraction.

## Features

- **Growable Exponents**: Handle very large or very small numbers by dynamically adjusting the exponent size
- **Fixed-Size Fractions**: Maintain precision consistency with IEEE 754-compatible 52-bit fractions  
- **IEEE 754 Compatibility**: Follows IEEE 754 double-precision format as the baseline
- **Special Value Support**: Handles NaN, positive/negative infinity, and zero values
- **Arithmetic Operations**: Addition and subtraction with proper overflow/underflow handling

## Installation

```bash
pip install flexfloat
```

## Development Installation

```bash
pip install -e ".[dev]"
```

## Usage

```python
from flexfloat import FlexFloat

# Create FlexFloat instances
a = FlexFloat.from_float(1.5)
b = FlexFloat.from_float(2.5)

# Perform arithmetic operations
result = a + b
print(result.to_float())  # 4.0

# Handle very large numbers
large_a = FlexFloat.from_float(1e308)
large_b = FlexFloat.from_float(1e308)
large_result = large_a + large_b
# Result has grown exponent to handle overflow
print(len(large_result.exponent))  # > 11 (grows beyond IEEE 754 standard)
```

## Running Tests

```bash
python -m pytest tests
```


## License

MIT License
