Reputation: 0 Apprentice
- New Members
- Active Posts:
- 8 (0.01 per day)
- 27-July 12
- Profile Views:
- Last Active:
- Aug 31 2012 03:29 AM
- Dream Kudos:
Posts I've Made
Posted 31 Aug 2012From your code it looks like you're trying to implement Newton's method and you don't know which value to use as the second argument to the improve function - is this correct¹? If so, do you know what the second value should be logically and you just don't know how to keep track of that value in the code or don't you fully understand Newton's method?
Yes, I am trying to implement Newton's Method and I don't know what the second value should be and don't know how to keep track of the value.
QuoteIn general you should think about what each variable in your code is supposed to represent and then make sure that you use that variable in that way. For example the n in cube-root is supposed to be the number whose cube root you're supposed to find, correct? And the value returned by improve is supposed to be an improved guess of what the cube root might be, right? And you're then passing that possible cube root as the new value of n - does that make sense?
Yes, that all is correct and makes sense
QuoteAlso your good-enough? function takes 2 arguments, but uses 3.
I see that now. I was getting so frustrated and I guess I added a variable and just didn't fully understand what I was doing. I really am having a hard time with functional programming.
Quote¹ In the future it would help if you point these things out explicitly, so I don't have to guess based on the code.
I will be more specific in the future, thank you!
- Member Title:
- New D.I.C Head
- Age Unknown
- Birthday Unknown
rarment hasn't added any friends yet.