complicated math?
how do i get this math out to good c++ code?
for example:
in*Óranta^years
where Ó go from x to y
??
More info is needed...
Is this a summation of the form a * b ^ c where b goes from x to y , which are integer values? If so, you can use the pow() function to calculate b ^ c , and a for loop to do the overall summation.
int Agony() { return *((int*)0); } Mwahaha... >8)
Is this a summation of the form a * b ^ c where b goes from x to y , which are integer values? If so, you can use the pow() function to calculate b ^ c , and a for loop to do the overall summation.
int Agony() { return *((int*)0); } Mwahaha... >8)
"We should have a great fewer disputes in the world if words were taken for what they are, the signs of our ideas only, and not for things themselves." - John Locke
yes this is a summation...
for example:
a* summation of (b)^n where n goes from x to y..
any nice example?
for example:
a* summation of (b)^n where n goes from x to y..
any nice example?

why not just use the formula for the summation of a geometric series
(1-r^n )/(1 - r)
this way you would have to use pow() at most 2 times.
(1-r^n )/(1 - r)
this way you would have to use pow() at most 2 times.
March 19, 2004 01:53 PM
in case want to use the loop & you want this:
"a* summation of (b)^n where n goes from x to y..."
don''t use penguins, use this...
there are subtle differences : )
"a* summation of (b)^n where n goes from x to y..."
don''t use penguins, use this...
int sum = 0; for( int n=x ; n <= y ; n++ ) { sum += pow( b, n ); } int result = a * sum;
there are subtle differences : )
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement