chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] Possible numbers bug


From: Kon Lovett
Subject: Re: [Chicken-users] Possible numbers bug
Date: Fri, 27 May 2011 13:55:55 -0700


On May 27, 2011, at 1:02 PM, Matt Welland wrote:

Bit easier to compare the md5sum of the result :)

Using 4.6.5 on 64bit:

chlr11732> csi -b -n -q blah.scm | md5sum
e8e0bb7648422c33ce821c53e7af02d0  -

chlr11732> ./blah | md5sum
e8e0bb7648422c33ce821c53e7af02d0  -

stk (not stklos):
./blah2.stk | md5sum
75635ac7a6c8b9c3cc98227f92e272ab  -
(num is 10003.....24324)

Bah! No, md5sum is not the way to go - subtleties such as newlines can
mess it up.

csi -b -n -q -e '(use md5 message-digest numbers) (define (sum-of- exponents n lim) (if (> n lim) 0 (+ (expt n n) (sum-of-exponents (+ n 1) lim)))) (print (message-digest-string (md5-primitive) (number- >string (sum-of-exponents 1 1000))))'
Chicken PPC:
520cbadfbf1e95567b1b49bd543fa8ab
Chicken x86:
520cbadfbf1e95567b1b49bd543fa8ab

(Done as above but w/ a string literal rather than the`(number->...)' expression.)
Racket:
520cbadfbf1e95567b1b49bd543fa8ab

Note that using the RSA utility md5 & string literals I get the same digest value.


On Fri, May 27, 2011 at 10:21 AM, Kon Lovett <address@hidden> wrote:

On May 27, 2011, at 1:58 AM, Dominic Pearson wrote:

Hello folks,

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.

Using

CHICKEN
(c)2008-2011 The Chicken Team
(c)2000-2007 Felix L. Winkelmann
Version 4.7.0
macosx-unix-gnu-ppc [ manyargs dload ptables ]
compiled 2011-05-25 on Nikko.local (Darwin)

&

CHICKEN
(c)2008-2011 The Chicken Team
(c)2000-2007 Felix L. Winkelmann
Version 4.7.0
macosx-unix-gnu-x86 [ manyargs dload ptables ]
compiled 2011-05-25 on Otter.local (Darwin)

I get the Racket answer.


_______________________________________________
Chicken-users mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/chicken-users


_______________________________________________
Chicken-users mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/chicken-users





reply via email to

[Prev in Thread] Current Thread [Next in Thread]