Advertisement
imk0tter

Encode infinite number of dimensions of numbers to one number

Jul 25th, 2023 (edited)
1,717
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.35 KB | None | 0 0
  1. # Encode infinite number of dimensions of numbers to one number
  2. # INPUT:
  3. # x = -infinity to infinity up by 1
  4. # args[0:infinity]= every number between -infinity and infinity
  5. # NO COLLISIONS
  6. def INFINITY_UNIQUE_NUMBER_SERIES(x, *args):
  7.     if (len(args) > 0): return INFINITY_UNIQUE_NUMBER_SERIES((x * 2 - 1) * (2 ** args[0]), *args[1:])
  8.     return x
  9.  
Advertisement
Comments
  • imk0tter
    1 year
    # text 0.67 KB | 0 0
    1.  
    2. X = (y * 2 - 1) * (2^z) solve for z and y given x
    3.  
    4. z = log2(x / y * 2 - 1)
    5. y = (X / (2 ^ z) + 1 / 2)
    6.  
    7. z = log2(x / (x / (2 ^ z) + 1 / 2) * 2 - 1)
    8. y = (x / (2 ^ z) + 1 / 2)
    9.  
    10. z = log2(x / (X / (2 ^ log2(x / (X / (2 ^ z) + 1 / 2) * 2 - 1)) + 1 / 2) * 2 - 1)
    11. z = log2(x / (X / (2 ^ log2(x / (X / (2 ^ log2(x / (X / (2 ^ z) + 1 / 2) * 2 - 1)) + 1 / 2) * 2 - 1)) + 1 / 2) * 2 - 1)
    12.  
    13.  
    14.  
    15. x = ((((y * 2 - 1) * (2^z)) * 2 - 1) * (2^e)) solve for z and y and e given x
    16.  
    17. z = log2((((X / (2^e) + 1) / 2) / (2^z) + 1) / (2 * ((((X / (2^e) + 1) / 2) / (2^z) + 1) / 2)))
    18.  
    19. y = (((X / (2^e) + 1) / 2) / (2^z) + 1) / 2
    20.  
    21. e = log2((((X / (2^e) + 1) / 2) / (2^z) + 1) / (2 * y))
    22.  
    23.  
Add Comment
Please, Sign In to add comment
Advertisement