Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def sqrt(x: Double): Stream[Double] = {
- def go(guess: Double): Stream[Double] = {
- val newGuess = (guess + x/guess)/2
- newGuess #:: go(newGuess)
- }
- go(x)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement