Комментарии пользователя

Место комментария Текст Дата
1.6 Особая форма The book doesn't prepare us for this question. Readers will likely think the issue is a difference between if and cond; it's not. The issue is that wrapping cond in a function changes how arguments are evaluated. When a function is evaluated, its arguments are evaluated right away. But it's impossible to evaluate the arguments to new-if, because sqr-iter simply calls itself repeatedly. See https://stackoverflow.com/questions/1171252/whats-the-explanation-for-exercise-1-6-in-sicp 2022-11-05
1.7 Квадратный корень The problem with small numbers is easy enough to understand: the tolerance of .001 is arbitrary, and does not scale with the number whose square we are seeking, so with very small numbers, the resolution is insufficiently fine to improve the guess. The problem with large numbers is not intuitive, and the text does not prepare us to explain the problem. 2022-11-06
1.7 Квадратный корень Here's one explanation: "For large radicands, the procedure sqrt-iter enters an infinite recursion because the tolerance is not scaled up to the large radicands and floating-point numbers are represented with limited precision so the absolute error at that scale is always greater than the tolerance." 2022-11-06
1.7 Квадратный корень The "solution" given is NOT a solution to the actual problem. In a correct solution, the good-enough? procedure should be modified to test against "a very small fraction of the guess," e.g., (.0000001 * guess). Instead of doing this, the "solution" just substitutes a smaller, still absolute, tolerance for .001, using 0.0000001. This improves the resolution for small numbers but doesn't work for large numbers and is not what is asked for. 2022-11-06