• + 0 comments

    The thing about computing using that formula is that you're going to have to do floating-point calculations. This raises a couple of issues:

    1. Can you easily estimate the amount of precision you're going to need to take a small number to a large number and have the rounding error be less than 0.5?

    2. Is it even more efficient to use the closed form? Integer addition and modulo operations are faster than calculating exponentials and logarithms, and the extra storage space is neglible.