Skip to content

Commit 0b0303d

Browse files
committed
docs: sync SI_STEPS, NIST_STEPS, ALL_UNIT_TYPES constants with code
SI_STEPS was missing Z and Y entries; NIST_STEPS was missing Zi and Yi (added with the ZiB/YiB/Zib/Yib units in 2.0.0); ALL_UNIT_TYPES used the old 'b'/'B' spellings instead of 'Bit'/'Byte' and was missing the Zb/ZB/Yb/YB/Zib/ZiB/Yib/YiB entries added this release.
1 parent d2c5331 commit 0b0303d

2 files changed

Lines changed: 17 additions & 12 deletions

File tree

docsite/source/appendices/mixed_math.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ Internally, this is implemented as:
100100
*Division*
101101
The result will be a number type due to unit cancellation.
102102

103+
.. _appendix_math_mixed_types:
103104

104105
Mixed Types: Addition and Subtraction
105106
=====================================

docsite/source/module.rst

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -237,12 +237,12 @@ bitmath.sum()
237237

238238
.. note::
239239

240-
Python's built-in :py:func:`sum` also works with bitmath objects.
241-
Because ``0 + bm`` returns ``bm`` itself (the ``__radd__`` identity
242-
element), the built-in accumulates into the type of the **first
243-
element** in the iterable. Use :py:func:`bitmath.sum` instead when
244-
you need the result normalised to a **specific unit** regardless of
245-
the input types.
240+
Python's built-in :py:func:`sum` also works with bitmath
241+
objects. Because ``0 + bm`` returns ``bm`` itself, the built-in
242+
accumulates into the type of the **first element** in the
243+
iterable. Use :py:func:`bitmath.sum` instead when you need the
244+
result normalised to a **specific unit** regardless of the input
245+
types.
246246

247247
Sum a homogeneous list — result type matches ``start`` (``Byte`` by
248248
default):
@@ -878,7 +878,9 @@ behavior.
878878
'G': 1000000000,
879879
'T': 1000000000000,
880880
'P': 1000000000000000,
881-
'E': 1000000000000000000
881+
'E': 1000000000000000000,
882+
'Z': 1000000000000000000000,
883+
'Y': 1000000000000000000000000
882884
}
883885
884886
@@ -900,7 +902,9 @@ behavior.
900902
'Gi': 1073741824,
901903
'Ti': 1099511627776,
902904
'Pi': 1125899906842624,
903-
'Ei': 1152921504606846976
905+
'Ei': 1152921504606846976,
906+
'Zi': 1180591620717411303424,
907+
'Yi': 1208925819614629174706176
904908
}
905909
906910
@@ -911,10 +915,10 @@ behavior.
911915

912916
.. code-block:: python
913917
914-
ALL_UNIT_TYPES = ['b', 'B', 'kb', 'kB', 'Mb', 'MB', 'Gb', 'GB',
915-
'Tb', 'TB', 'Pb', 'PB', 'Eb', 'EB', 'Kib', 'KiB', 'Mib',
916-
'MiB', 'Gib', 'GiB', 'Tib', 'TiB', 'Pib', 'PiB', 'Eib',
917-
'EiB']
918+
ALL_UNIT_TYPES = ['Bit', 'Byte', 'kb', 'kB', 'Mb', 'MB', 'Gb', 'GB',
919+
'Tb', 'TB', 'Pb', 'PB', 'Eb', 'EB', 'Zb', 'ZB', 'Yb', 'YB',
920+
'Kib', 'KiB', 'Mib', 'MiB', 'Gib', 'GiB', 'Tib', 'TiB',
921+
'Pib', 'PiB', 'Eib', 'EiB', 'Zib', 'ZiB', 'Yib', 'YiB']
918922
919923
.. py:module:: bitmath.integrations
920924

0 commit comments

Comments
 (0)