Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Runtime

Name: Anonymous 2012-08-25 0:34

when i use pow(x,y) in C, is such a thing calculated in constant or linear runtime?

Name: Anonymous 2012-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).

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List