Skip to main content

Round mantissa of a float number

Project description

pip install -U roundmantissa

roundmantissa

Tiny library :baby_chick: that rounds floating point numbers based on the length of their mantissa.

5.0 = 4.0 + 1.0 = (1 + 1/4) * 2**2 = b1.01 * 2**2
round_mantissa(5.0, 0) = b1. * 2**2
round_mantissa(5.0, 1) = b1.0 * 2**2
round_mantissa(5.0, 2) = b1.01 * 2**2

:hatched_chick: :hatched_chick: :hatched_chick:

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

roundmantissa-0.2.1.tar.gz (3.4 kB view hashes)

Uploaded Source

Built Distribution

roundmantissa-0.2.1-py3-none-any.whl (4.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page