Got this question on a homework assignment in algorithms class, and thought it was pretty cool (or rather, the solution is pretty cool): develop an algorithm to calculate x^pow % mod, which does not use big numbers (numbers that take more than one processor word to store, and more than one processor math operation for each calculation).
Random fact: 1928374655647382910^9223372036854775808 % 4123456789 = 3021338089
In other news, posts about generally cool things will now be tagged 'squishy', rather than the previously used 'shiny'.
Search This Blog
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment