title: Babylonian square root algorithm - initial guess value
body: <p>I was looking for Babylonian square root algorithm written in JavaScript, and found this working solution:</p>
  
  <pre><code>function sqrt(num) {
    var accuracy = 0.000001;
  
    function isPrecise(estimation) {
      if (Math.abs( Math.pow(estimation, 2) - num ) &lt; accuracy) {
        return true
      } else {
        return false
      }
    }
  
    function improvePrecision(estimation) {
      return (estimation + (num / estimation)) / 2;
    }
  
    function iteration(estimation) {
      if(isPrecise(estimation)) {
        return estimation;
      } else {
        return iteration(improvePrecision(estimation));
      }
    }
  
    return iteration(num);
  }
  </code></pre>
  
  <p>But I can't see where is initial guess (in code - <code>estimation</code>) value is defined. So how it works, when there is no guess value on first iteration? Actually, this value should be eaqual to <code>num</code> argument.</p>