GNU bug report logs -
#13031
large numbers
Previous Next
Full log
View this message in rfc822 format
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 <ludo <at> gnu.org> wrote:
> Hi,
>
> Jozef Chraplewski <jozef <at> applicake.com> 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’.
This bug report was last modified 12 years and 164 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.