when i use pow(x,y) in C, is such a thing calculated in constant or linear runtime?
Name:
Anonymous2012-08-25 0:42
Such a thing is implementation dependent.
It wouldn't surprise me if most compilers took advantage of y being a constant, if y is in an integer you could do it recursively in logarithmic time (if you allow the result to be slightly altered, floating point math is rarely associative).