How does one compare large numbers python? I have the following two numbers:
x = 99 ^ 85, y = 73 ^ 62.
Computing both numbers in the python interpreter gives the following results:
>>> x = 99 ** 85
>>> x
42559012338865490805205255842468783301592970011660094241731171697575386634867177511754750618655432231509140219114042806178869109409115320236642740915044006252790234308499
>>> y = 73 ** 62
>>> y
33575100975948386797110696048991269305533302609246066947133332393856972076850553634350302934134549900847114729991729
Even without computing the results it's quite obvious that x will be greater than y. I performed mod 1000000007
on both numbers in order to reduce the number of digits. I got the following results:
>>> mod = 1000000007
>>> x % mod
195405172
>>> y % mod
297675700
>>>
As you can see the mod results of the numbers results in y being greater than x. Is there an efficient of comparing large numbers and get the right results. I don't think this problem is bound to python alone though the context of the question is under python.
Thanks in advance