65 ms·
Given the function to compute pi: while (Math.abs(term) > tolerance) { term = ...; sum += term; } return sum * 4; Wouldn’t that return a value w
by kstrauser 2y ago
Given the function to compute pi:
while (Math.abs(term) > tolerance) {
term = ...;
sum += term;
}
return sum * 4;
Wouldn’t that return a value where the error of the result is 4x the requested tolerance?