Ok so can someone help me with adding exponants to a caculator

Printable View

- 02-12-2005digdug4lifeexpontants??
Ok so can someone help me with adding exponants to a caculator

- 02-12-2005wgdb198
how about

double exp (double) from the <math.h> library

that is e to the power of x .

Other functions at

http://www.opengroup.org/onlinepubs/...sh/math.h.html - 02-12-2005Exile
Just make a loop out of it, something like this:

Code:`int Base = 2, Exp = 5, ctr, Result;`

Result = Base;

for (ctr = 0; ctr < Exp; ctr++)

{

Result *= Base;

}

- 02-12-2005Kybo_RenQuote:

Originally Posted by**wgdb198**

Instead, use cmath and the std namespace.