Possible Duplicate:
How did Python implement the built-in function pow()?
I was sifting through some of the developer docs and C code that python is written in and couldn't quite figure it out. At what level would this be defined? would it be in the C code that defines python or would it be in the assembler that C is built on? (is that what C is built on?).
To elaborate on the question a little there are a few ways to handle different mathematical operations and they vary in time complexity, I am trying to find out which algorithm python uses for modular exponentiation (if you know about the implementation of the other operations that would be great also).
I am looking specifically for the implementation details but any comments or resources about where this would be defined, or general thoughts on the matter would be appreciated.