Compute orders of magnitude
Project description
logscale
This Python package provides a single function, order_of_magnitude(), which computes and returns the order of magnitude of a given number in a standardized string format.
The order of magnitude gives a compact representation of a number as a product of a coefficient and a power of 10, where the coefficient is constrained to lie within the interval [1/√10, √10). For more information, see the wikipedia article on orders of magnitude.
Installation
If you are using uv, you can install the package from PyPI with:
uv pip install logscale
Alternatively, with regular pip:
pip install logscale
Examples
from logscale import order_of_magnitude
order_of_magnitude(129) # "1.3e2"
order_of_magnitude(0.0001) # "1.0e-4"
order_of_magnitude(456) # "0.46e3"
order_of_magnitude(70.2) # "0.70e2"
order_of_magnitude(0) # "0.0e0"
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file logscale-0.1.2.tar.gz.
File metadata
- Download URL: logscale-0.1.2.tar.gz
- Upload date:
- Size: 17.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f28a03b2cbcacceb74e5076ea77a5903216a2140580bb01b662a7a1c76ed35ae
|
|
| MD5 |
f354d4b788b3aaf362bbe9c4583618fb
|
|
| BLAKE2b-256 |
155f1df4e841a63768a6c2cf5b51ae6b467ea3aa2337b86a873309d7d0f3130c
|
Provenance
The following attestation bundles were made for logscale-0.1.2.tar.gz:
Publisher:
cd.yaml on 8-hat/logscale
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
logscale-0.1.2.tar.gz -
Subject digest:
f28a03b2cbcacceb74e5076ea77a5903216a2140580bb01b662a7a1c76ed35ae - Sigstore transparency entry: 899764846
- Sigstore integration time:
-
Permalink:
8-hat/logscale@1313afd8ebabc9e8a88d8df6fcc36cfba095cde2 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/8-hat
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
cd.yaml@1313afd8ebabc9e8a88d8df6fcc36cfba095cde2 -
Trigger Event:
release
-
Statement type:
File details
Details for the file logscale-0.1.2-py3-none-any.whl.
File metadata
- Download URL: logscale-0.1.2-py3-none-any.whl
- Upload date:
- Size: 15.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bb7e413566f79367f4b6af5e7bcddee9669bd796d3dfc439c283f3455db22c85
|
|
| MD5 |
15221914846b499853420302b453c149
|
|
| BLAKE2b-256 |
7b2e34f3bd831248c0e4b604fa8a3fa43fd8887d8eb357fa16eadb1e96826c0f
|
Provenance
The following attestation bundles were made for logscale-0.1.2-py3-none-any.whl:
Publisher:
cd.yaml on 8-hat/logscale
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
logscale-0.1.2-py3-none-any.whl -
Subject digest:
bb7e413566f79367f4b6af5e7bcddee9669bd796d3dfc439c283f3455db22c85 - Sigstore transparency entry: 899764903
- Sigstore integration time:
-
Permalink:
8-hat/logscale@1313afd8ebabc9e8a88d8df6fcc36cfba095cde2 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/8-hat
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
cd.yaml@1313afd8ebabc9e8a88d8df6fcc36cfba095cde2 -
Trigger Event:
release
-
Statement type: