I'd just use a constant.I don't care - would just do 4 * arctan(1.0) anyway.
Soma
I'd just use a constant.I don't care - would just do 4 * arctan(1.0) anyway.
Soma
"...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.." Bill Bryson
I might do the loop more like this:
but to each his own.Code:double numerator = -1.0 double taylor = 1.0; for (int i = 3; i < terms; i+=2, numerator *= -1) { taylor += numerator/i; }