unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* bug#14879: fixnum-width, greatest-fixnum and least-fixnum disagree
@ 2013-07-16 14:02 Göran Weinholt
  2013-07-16 21:41 ` Mark H Weaver
  0 siblings, 1 reply; 2+ messages in thread
From: Göran Weinholt @ 2013-07-16 14:02 UTC (permalink / raw)
  To: 14879

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

Hello schemers,

scheme@(guile-user)> (import (rnrs))
scheme@(guile-user)> (fixnum-width)
$1 = 61
scheme@(guile-user)> (greatest-fixnum)
$2 = 2305843009213693951
scheme@(guile-user)> (least-fixnum)
$3 = -2305843009213693952

If the reported fixnum width is correct, then these should be the least
and greatest fixnums:

  (- (expt 2 (- (fixnum-width) 1)))   => -1152921504606846976
  (- (expt 2 (- (fixnum-width) 1)) 1) => 1152921504606846975

If the reported least and greatest fixnums are correct, then the fixnum
width is actually 62.

Tested with 2.0.9.33-3bbca-dirty on an amd64 system.

Regards,

-- 
Göran Weinholt <goran@weinholt.se>
20             JUSTICE KENNEDY:  That seems odd.  I mean,
21 Microsoft doesn't say please buy our disk because it's
22 the prettiest disk in the business.

[-- Attachment #2: Type: application/pgp-signature, Size: 835 bytes --]

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

* bug#14879: fixnum-width, greatest-fixnum and least-fixnum disagree
  2013-07-16 14:02 bug#14879: fixnum-width, greatest-fixnum and least-fixnum disagree Göran Weinholt
@ 2013-07-16 21:41 ` Mark H Weaver
  0 siblings, 0 replies; 2+ messages in thread
From: Mark H Weaver @ 2013-07-16 21:41 UTC (permalink / raw)
  To: Göran Weinholt; +Cc: 14879-done

Göran Weinholt <goran@weinholt.se> writes:

> scheme@(guile-user)> (import (rnrs))
> scheme@(guile-user)> (fixnum-width)
> $1 = 61
> scheme@(guile-user)> (greatest-fixnum)
> $2 = 2305843009213693951
> scheme@(guile-user)> (least-fixnum)
> $3 = -2305843009213693952
>
> If the reported fixnum width is correct, then these should be the least
> and greatest fixnums:
>
>   (- (expt 2 (- (fixnum-width) 1)))   => -1152921504606846976
>   (- (expt 2 (- (fixnum-width) 1)) 1) => 1152921504606846975
>
> If the reported least and greatest fixnums are correct, then the fixnum
> width is actually 62.

That's correct.  Fixed in 06903786211afd9a554b8f009a37111f729607ee.

    Thanks!
      Mark





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

end of thread, other threads:[~2013-07-16 21:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-16 14:02 bug#14879: fixnum-width, greatest-fixnum and least-fixnum disagree Göran Weinholt
2013-07-16 21:41 ` 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).