On 27 May 2011 09:58, Dominic Pearson
<address@hidden> wrote:
I am trying to compute the sum i = 0 to n where n = 1000 of n^n, but
chicken seems to return the incorrect answer.
http://paste.call-cc.org/paste?id=e0884580a684d1220f3dedb819f63201b6f5eb1a
Racket and scheme48 both seem to give different answers too.
Oddly enough, when I run your code (both versions), I get the same answer as you did for Racket. Also, the Ruby program below agrees with *my* Chicken answer (and your Racket answer). (My computer here is a bit behind the times - this is on Chicken 4.6.2)
---
sum = 0
1.upto(1000) do |i|
sum += (i ** i)
end
puts sum
---
cheers,
Peter.
_______________________________________________
Chicken-users mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/chicken-users