Apr 27, 2011 at 2:53am
Hey, I know on a calculator a carrot is used a certain way, like in an amortization table. How do I use it in c++ in that same way like this:
var = var^(t*12);
How would I get that to work so it used the carrot like it does on the calculator?
Apr 27, 2011 at 3:00am
You don't. If you need to raise something to an exponent in C++, you use the pow() function in cmath:
The ^ operator has a completely different and unrelated meaning in C++
Last edited on Apr 27, 2011 at 3:00am
Apr 27, 2011 at 3:15am
BTW, a carrot is a vegetable.
The chevron-shaped symbol you are thinking about is a caret.
Hope this helps.