0

Why there is no operator for exponentiation in C++ ?

C++ is considered to a powerful programming language which is used for the development of most of the popular software today. But why such a powerful language does not have an operator for exponentiation(raising a number to the power of - Example 5 to the power of 20). Of course, there is a pow() function and one can define own a function for that. When languages like VB or application like Excel provide ** or ^ for this operation, I wonder why a powerful language like C++ does not have this. For that matter I wonder why C and Java also do not have an operator for exponentiation. How can we call these as powerful languages?

11th Sep 2017, 4:03 AM
Antony Marianathan
Antony Marianathan - avatar
2 odpowiedzi
0
There is actually powers of two though. 1 << n is equal to 2^n, and it is really fast.
11th Sep 2017, 8:32 AM
Testing003