Skip to main content

Python classes that provides support for extended integers (the set of integers, and infinity).

Project description

This repository provides a Python base class that implements extended integers.


In [1]: from numbers import Real, Integral

In [2]: from extended_int import ExtendedIntegral, int_inf

In [3]: float(int_inf)
Out[3]: inf

In [4]: print(int_inf)

In [5]: int(int_inf)
OverflowError                             Traceback (most recent call last)

In [6]: isinstance(int_inf, Real)
Out[6]: True

In [7]: isinstance(int_inf, Integral)
Out[7]: False

In [8]: isinstance(2.5, ExtendedIntegral)

Out[8]: False

In [9]: isinstance(int_inf, ExtendedIntegral)

Out[9]: True

In [10]: isinstance(2, ExtendedIntegral)

Out[10]: True

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for extended-int, version 0.6
Filename, size File type Python version Upload date Hashes
Filename, size extended_int-0.6-py3-none-any.whl (4.1 kB) File type Wheel Python version py3 Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page