pairing
pairing copied to clipboard
Encode pairs of integers as single integer values using the Cantor pairing algorithm
Some objects might represent integers, and implement basic arithmetic operations with integers (+1 and //2) through https://docs.python.org/3/reference/datamodel.html#emulating-numeric-types While they are not python numbers, they could still be paired with this...
Fix for the bigint issue: Removed any floating point calculations, using an improved integer sqrt algorithm from https://stackoverflow.com/a/31224469/8637159
Hi, Well, it looks like the logic is broken. ValueError: 25 and 34792481337 cannot be paired Thanks, Gergely
Is it possible to map two doubles too? Or do you know of any alorightms that are capable of doing so? Thanks in advance!