Epic Interview Question

Please write a function that accepts a floating number and returns its square-root. You may not use built-in square root function from your language. However, basic operators like addition, subtraction, multiplication are allowed. Please take into consideration the floating precision.

Interview Answers

Anonymous

Jun 7, 2011

Newton's method: http://en.wikipedia.org/wiki/Newton's_method

2

Anonymous

Mar 22, 2012

http://www.dreamincode.net/code/snippet244.htm

1

Anonymous

Aug 29, 2009

Hint: please really take into consideration the floating point.