- 2

What is the Algorithm?

What's the Algorithm for cube root and square root and pow? Any one can help me?

20th Jan 2022, 9:23 PM
ABUBAKAR ALHOMIDY
ABUBAKAR ALHOMIDY - avatar
4 Answers
+ 1
For power you can simply multiply the number power times For square root and cube root you can use binary search or Newton's method
21st Jan 2022, 1:36 AM
YUGRAJ
0
HungryTradie the ** operator in C++ is interpreted as double de-reference, not exponent.
20th Jan 2022, 11:39 PM
Brian
Brian - avatar
- 2
G'day ABUBAKAR ALHOMIDY What math could you use? edit: yep, I was wrong! This is for Python not in C++ (For pow could you substitute: var**num For root could you use: var**(1/num) Maybe that is too simple, maybe I'm just wrong....)
20th Jan 2022, 9:30 PM
HungryTradie
HungryTradie - avatar