unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* bug#15320: [2.0.7] Rational number representation problem
@ 2013-09-10 13:28 Josh Stokes
  2013-09-12 21:03 ` Mark H Weaver
  0 siblings, 1 reply; 2+ messages in thread
From: Josh Stokes @ 2013-09-10 13:28 UTC (permalink / raw)
  To: 15320

[-- Attachment #1: Type: text/plain, Size: 254 bytes --]

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.

[-- Attachment #2: Type: text/html, Size: 276 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* bug#15320: [2.0.7] Rational number representation problem
  2013-09-10 13:28 bug#15320: [2.0.7] Rational number representation problem Josh Stokes
@ 2013-09-12 21:03 ` Mark H Weaver
  0 siblings, 0 replies; 2+ messages in thread
From: Mark H Weaver @ 2013-09-12 21:03 UTC (permalink / raw)
  To: Josh Stokes; +Cc: 15320-close

Josh Stokes <jsstokes2@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





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-09-12 21:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-10 13:28 bug#15320: [2.0.7] Rational number representation problem Josh Stokes
2013-09-12 21:03 ` Mark H Weaver

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).