Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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?


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: