code_junkie

Algorithm to add two digits to the end of a number to calculate a specific modulus?

Nov 12th, 2011
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.14 KB | None | 0 0
  1. x = 123456
  2.  
  3. x = x * 100
  4. newX = x + 1 + 97 - (x % 97)
  5.  
  6. X = Y -(Number*100 mod y) - 1
  7.  
  8. Number = 123456
  9. Y = 97
  10. X the number you need
Add Comment
Please, Sign In to add comment