GNU bug report logs - #13031
large numbers

Previous Next

Package: guile;

Reported by: Jozef Chraplewski <jozef <at> applicake.com>

Date: Thu, 29 Nov 2012 17:51:02 UTC

Severity: normal

Done: Mark H Weaver <mhw <at> netris.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Jozef Chraplewski <jozef <at> applicake.com>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 13031 <at> debbugs.gnu.org
Subject: bug#13031: large numbers
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 <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.