All that code came straight out of the text, except that I used if instead of cond. The sum, accu-sum, and g-series defs are all given. In your results I see a difference. When I run it at home it's the same. I can even (equal? (sum (listof number)) (accu-sum (listof number))) and get true.<br>
<br>
<div class="gmail_quote">On Tue, Jan 4, 2011 at 08:10, Carl Eastlund <span dir="ltr"><<a href="mailto:cce@ccs.neu.edu">cce@ccs.neu.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Luke,<br><br>In the future, please do not post complete (or nearly complete)<br>homework solutions to the list. Try to find a slightly more indirect<br>
way to ask your question -- we're happy to answer, we just don't want<br>copy/paste solutions floating around. For now, though, here are the<br>results I get with your code:<br><br>Welcome to Racket v5.0.99.5.<br>
> (require "31.3.1.rkt")<br>-0.4974659600326926<br>-0.49746596003269405<br>-4974659600326926.0<br>-4974659600326941.0<br>><br><br>Those look different to me. Try subtracting one from the other to see<br>how different. Or, show us the results you get if you don't get the<br>
same results.<br><font color="#888888"><br>Carl Eastlund<br></font>
<div>
<div></div>
<div class="h5"><br>On Mon, Jan 3, 2011 at 10:48 PM, Luke Jordan <<a href="mailto:luke.jordan@gmail.com">luke.jordan@gmail.com</a>> wrote:<br>> When I run the plain recursive vs. the accumulator version of sum with<br>
> g-series, I get the same result, which the text says isn't supposed to<br>> happen. Code attached. What am I missing?<br>> Luke<br></div></div></blockquote></div><br>