GNU bug report logs - #15320
[2.0.7] Rational number representation problem

Previous Next

Package: guile;

Reported by: Josh Stokes <jsstokes2 <at> googlemail.com>

Date: Tue, 10 Sep 2013 15:45: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: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Mark H Weaver <mhw <at> netris.org>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#15320: closed ([2.0.7] Rational number representation problem)
Date: Thu, 12 Sep 2013 21:04:03 +0000
[Message part 1 (text/plain, inline)]
Your message dated Thu, 12 Sep 2013 17:03:34 -0400
with message-id <8738p9n461.fsf <at> tines.lan>
and subject line Re: bug#15320: [2.0.7] Rational number representation problem
has caused the debbugs.gnu.org bug report #15320,
regarding [2.0.7] Rational number representation problem
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
15320: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=15320
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Josh Stokes <jsstokes2 <at> googlemail.com>
To: bug-guile <at> gnu.org
Subject: [2.0.7] Rational number representation problem
Date: Tue, 10 Sep 2013 14:28:37 +0100
[Message part 3 (text/plain, inline)]
It seems that certain small numbers are represented as integers, as (*
4294967296 4294967296) results in 0, but (* 3294967296 3294967296) returns
the correct value of 10856809481709551616. In addition, (ash 1 64) gives 0,
but (ash 1 65) works correctly.
[Message part 4 (text/html, inline)]
[Message part 5 (message/rfc822, inline)]
From: Mark H Weaver <mhw <at> netris.org>
To: Josh Stokes <jsstokes2 <at> googlemail.com>
Cc: 15320-close <at> debbugs.gnu.org
Subject: Re: bug#15320: [2.0.7] Rational number representation problem
Date: Thu, 12 Sep 2013 17:03:34 -0400
Josh Stokes <jsstokes2 <at> googlemail.com> writes:

> It seems that certain small numbers are represented as integers, as (*
> 4294967296 4294967296) results in 0, but (* 3294967296 3294967296)
> returns the correct value of 10856809481709551616. In addition, (ash 1
> 64) gives 0, but (ash 1 65) works correctly.

This is fixed in Guile 2.0.9.

In case you're curious: this bug came into existence when C compilers
started optimizing out overflow checks, on the theory that if a signed
integer overflow occurs then the behavior is unspecified and thus the
compiler can do whatever it likes.

http://stackoverflow.com/questions/14495636/strange-multiplication-behavior-in-guile-scheme-interpreter/14498437#14498437

    Thanks,
      Mark


This bug report was last modified 11 years and 258 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.