Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

^^^^^^^^^^^^^^^^^^^^^^^^^^^ operator

Status
Not open for further replies.

enqueoshy

Programmer
Oct 25, 2003
4
MX
does C ++ support the ^ operator??
what should I use for this kind of operations?
(b^2 * 2*Yc/3)^(1/3)

please help?
 
Well one ^ would have been plenty rather than you falling asleep on the keyboard.

^ means exclusive-or (like & means AND and | means OR)

If you're looking for a power operator like some other languages, there isn't one. It exists as a library function.

So in your notation, b^2
would be in C++
Code:
#include <cmath>

double result = std::pow(b,2);

--
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top