catena.strings
safe_full_int_str(n)
Returns the full decimal representation of n as a string, without risking the integer-to-string conversion limit (PEP 678 / Python 3.11+).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
n
|
int
|
The integer to represent. |
required |
Source code in catena/strings.py
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 | |
safe_int_str(n, n_trailing=99)
Returns a string representation of n without risking the integer-to-string conversion limit (PEP 678 / Python 3.11+).
If abs(n) has fewer than 100 digits, the full decimal representation is returned. Otherwise only the last n_trailing digits are returned, zero-padded and prefixed with "...".
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
n
|
int
|
The integer to represent. |
required |
n_trailing
|
int
|
Number of trailing digits to show when n is large. Must satisfy 1 <= n_trailing <= 99. |
99
|
Source code in catena/strings.py
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | |