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


Message #8 received at 13031 <at> debbugs.gnu.org (full text, mbox):

From: Noah Lavine <noah.b.lavine <at> gmail.com>
To: Jozef Chraplewski <jozef <at> applicake.com>
Cc: 13031 <at> debbugs.gnu.org
Subject: Re: bug#13031: large numbers
Date: Thu, 29 Nov 2012 14:08:45 -0500
[Message part 1 (text/plain, inline)]
No, they are meant to be supported without any special treatment. I don't
know what is happening in your example.


On Thu, Nov 29, 2012 at 3:42 AM, Jozef Chraplewski <jozef <at> applicake.com>wrote:

> Hi,
>
> It looks that guile returns incorrect results when it works with really
> big numbers.
>
> I've found it during resolving problem 48 from Project Euler:
>
> http://projecteuler.net/problem=48
>
> 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've tested solution under other scheme implementations (MIT scheme,
> petite and mzscheme) and it works as it should.
>
> Does such a big numbers in guile require any special treatment or just
> they are not supported?
>
> Best,
> Jozef
>
>
>
[Message part 2 (text/html, inline)]

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.