Yes 
because we use divide and conquer method to solve recursively the problem 
and get the solution in O(log(n)) times where n is the power

On Thursday, January 14, 2016 at 10:06:39 PM UTC+5:30, Jingguo Yao wrote:
>
> What is the time complexity of Math.Pow(x, y) function (
> https://golang.org/pkg/math/#Pow) in terms of x and y when the values of 
> x and y are not for the special cases? I have skimmed the source code (
> https://golang.org/src/math/pow.go?s=1186:1216#L28). And it seems that 
> the time complexity is O(log2(y)). So the time complexity for 
> math.Pow(0.87, 16384) should be O(log2(16384)) = (log2(2^14)) = O(14).
>
> Is my understanding correct?
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/28bf1445-19dd-40d6-9fe9-30d3986ebedf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to