Subject: Re: bug#13031: large numbers

From: Jozef Chraplewski <[email-masked]>
Date: Fri, 30 Nov 2012 12:54:37 +0100

Hey guys,

I use guile 2.0.6, compiled on macbook pro 7.1 osx 10.8.2

I've compiled guild via home-brew package manager.

Here is the link to brew's formula with compilation options:
https://github.com/mxcl/homebrew/blob/master/Library/Formula/guile.rb

Best,
Jozef
On Nov 29, 2012, at 11:11 PM, Ludovic Courtès <[email-masked]> wrote:

> Hi,
> 
> Jozef Chraplewski <[email-masked]> skribis:
> 
>> The solution is trivial:
>> 
>> (define (problem-48 limit)
>> (define (F)
>>   (let loop ((n 1)
>>              (sum 0))
>>     (if (<= n limit)
>>         (loop (+ n 1) (+ sum (expt n n)))
>>         sum)))
>> 
>> (let* ((str (number->string (F)))
>>          (len (string-length str)))
>>   (substring str (- len 10) len)))
>> 
>> (display (problem-48 1000))
>> (newline)
>> 
>> 
>> The proper answer is 9110846700 but guile returns 6457854188
> 
> I also get 9110846700 with 2.0.6+ and 1.8.8+.  What version do you use?
> 
> (Bigloo 3.2a returns 5842605292, though.)
> 
> Ludo’.