File tree Expand file tree Collapse file tree 2 files changed +17
-2
lines changed
Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ authors = [
1313readme = " README.rst"
1414requires-python = " >=3.7"
1515dependencies = [
16- " egcd~=1 .0"
16+ " egcd~=2 .0"
1717]
1818
1919[project .urls ]
Original file line number Diff line number Diff line change @@ -1050,7 +1050,22 @@ def __len__(self: modulo) -> int:
10501050 4
10511051
10521052 Use of the built-in :obj:`len` function is the recommended approach
1053- for retrieving the ``modulus`` attribute of a :obj:`modulo` instance.
1053+ for retrieving the ``modulus`` attribute of a :obj:`modulo` instance
1054+ when the modulus is small. However, this will not work when the
1055+ modulus is ``2 ** 63`` or greater.
1056+
1057+ >>> len(mod(2 ** 63 - 1))
1058+ 9223372036854775807
1059+ >>> len(mod(2 ** 63))
1060+ Traceback (most recent call last):
1061+ ...
1062+ OverflowError: cannot fit 'int' into an index-sized integer
1063+
1064+ In such cases, the recommended approach is to leverage the
1065+ ``modulus`` attribute.
1066+
1067+ >>> mod(2 ** 63).modulus
1068+ 9223372036854775808
10541069 """
10551070 return self .modulus
10561071
You can’t perform that action at this time.
0 commit comments