%newton(number, number, number) -> number
%Author: James Atlas
%Description:
%  Finds the square root of a number within a threshold
%Examples:
%  newton(20, 16, 0.01) -> ~4
%  newton(10, 25, 0.01) -> ~5
%  newton(5, 100, 0.1) -> ~10
function out=newton(guess, number, threshold)
  if (closeEnough(guess*guess, number, threshold))
      out = guess;
  else
      newGuess = guess - ((guess * guess - number) / (2 * guess));
      out = newton(newGuess, number, threshold);
  end
  