Skip to main content

fuzzyfloat

PyPI version Build Status

A utility library that provides transparent floating point types with tolerances for equality comparison.

Getting Started

>>>from fuzzyfloat import rel_fp
>>>value = rel_fp(100)
>>>value == 100
True
>>>value == 99.99999999
True
>>>value == 100.00000001
True
>>>value = 1000
>>>value == 1000.0000001
True
>>>value = 10000
>>>value == 10000.000001
True
>>>value = 100000
>>>value == 100000.00001
True
>>>from fuzzyfloat import abs_fp
>>>value = abs_fp(100)
>>>value = 100000
>>>value == 100000.00001
False
>>>value == 100000.00000001
True

Setting different tolerances

from fuzzyfloat import FuzzyFloatMeta

class my_fp(metaclass=FuzzyFloatMeta, rel_tol=1e-05, atol=0.01):
    pass

Using a different underlying type

import numpy as np
from fuzzyfloat import FuzzyFloatMeta

class np_fp(metaclass=FuzzyFloatMeta, ftype=np.float128):
    pass

class c_fp(metaclass=FuzzyFloatMeta, ftype=complex):
    pass

Limitations

Any operations provided by the operators module will propogate the class type (and therefore the tolerances). However, there are many other functions, especially those that touch c extensions, where the type information will be lost, such as math.sqrt().

Metadata

Release files for fuzzyfloat 1.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fuzzyfloat 1.0.3
File Size Uploaded Provenance Actions
fuzzyfloat-1.0.3.tar.gz 2.7 kB Without provenance Details for fuzzyfloat-1.0.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for fuzzyfloat 1.0.3
File Interpreter ABI Platform Actions
fuzzyfloat-1.0.3-py3-none-any.whl Python 3 none any Details for fuzzyfloat-1.0.3-py3-none-any.whl

Total release size: 5.8 kB

Release files / fuzzyfloat-1.0.3.tar.gz

Download URL fuzzyfloat-1.0.3.tar.gz
Size 2.7 kB
Tags Source
SHA-256 checksum
How to use checksums
c5aeaaf6095b24179d2bc6132175d877d8ec3972a10cf09e6b5eb73fcc4bb8a7
BLAKE2b-256 checksum
How to use checksums
464748222255763bbd19b3604ece45bdb1eb7fba0238a01a29191e7e8cc354b4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.1.0 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.5

Release files / fuzzyfloat-1.0.3-py3-none-any.whl

Download URL fuzzyfloat-1.0.3-py3-none-any.whl
Size 3.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
161295469f25a69436bebb7b5ae65e3570a12f273ab443c450c8ba187c0f1a13
BLAKE2b-256 checksum
How to use checksums
e761173ce7ecd9b41ad3bd59c654b04b443c8ecc2d29e882fa7698c405e56713
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.1.0 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.5

Security for fuzzyfloat 1.0.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page