RE: RE: C++ program of (a) power (b) without using builtin function
You are viewing a single comment's thread from:

RE: C++ program of (a) power (b) without using builtin function

Words
75
Reading
1 min
Listen
Play
8y

Sorry but as you were correcting someone else's post (which is good) I thought that it was important to be accurate in yours.

You are right about the fact that 0**0 is controversial.

You could check for overflows condition in your loop:
if (a > (max_double / a))
But I agree that it's quite inneficient.
There might be some clever mathematical shortcut to check the above.

No, I'm no expert at math algorithm implementation. 😁

@irelandscape: Sorry but as | Ecency