From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?UTF-8?Q?G=C3=B6ran?= Weinholt Newsgroups: gmane.lisp.guile.bugs Subject: bug#14864: bitwise-arithmetic-shift-right is wrong for large shift amounts Date: Sun, 14 Jul 2013 18:08:55 +0200 Message-ID: <87a9lpdsyw.fsf@industria.weinholt.se> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Trace: ger.gmane.org 1373818509 9366 80.91.229.3 (14 Jul 2013 16:15:09 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 14 Jul 2013 16:15:09 +0000 (UTC) To: 14864@debbugs.gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Sun Jul 14 18:15:10 2013 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UyOx4-000353-4b for guile-bugs@m.gmane.org; Sun, 14 Jul 2013 18:15:10 +0200 Original-Received: from localhost ([::1]:57473 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UyOx3-0006sF-N0 for guile-bugs@m.gmane.org; Sun, 14 Jul 2013 12:15:09 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57024) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UyOwy-0006op-Oy for bug-guile@gnu.org; Sun, 14 Jul 2013 12:15:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UyOww-0006ft-Vi for bug-guile@gnu.org; Sun, 14 Jul 2013 12:15:04 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:59779) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UyOww-0006fb-Re for bug-guile@gnu.org; Sun, 14 Jul 2013 12:15:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1UyOww-0007DD-2B for bug-guile@gnu.org; Sun, 14 Jul 2013 12:15:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?G=C3=B6ran?= Weinholt Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Sun, 14 Jul 2013 16:15:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 14864 X-GNU-PR-Package: guile X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-guile@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.137381845927606 (code B ref -1); Sun, 14 Jul 2013 16:15:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 14 Jul 2013 16:14:19 +0000 Original-Received: from localhost ([127.0.0.1]:54094 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1UyOwE-0007BB-V9 for submit@debbugs.gnu.org; Sun, 14 Jul 2013 12:14:19 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:55123) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1UyOwC-0007Af-K7 for submit@debbugs.gnu.org; Sun, 14 Jul 2013 12:14:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UyOw6-0006TB-Cy for submit@debbugs.gnu.org; Sun, 14 Jul 2013 12:14:11 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:56788) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UyOw6-0006T7-AR for submit@debbugs.gnu.org; Sun, 14 Jul 2013 12:14:10 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56841) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UyOw5-0006ee-Cx for bug-guile@gnu.org; Sun, 14 Jul 2013 12:14:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UyOw4-0006Su-Ck for bug-guile@gnu.org; Sun, 14 Jul 2013 12:14:09 -0400 Original-Received: from iustitia.weinholt.se ([2a02:28f0:0:a::7dce:e5a8]:36496) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UyOw4-0006Sl-0m for bug-guile@gnu.org; Sun, 14 Jul 2013 12:14:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=weinholt.se; s=iustitia2012; h=Content-Type:MIME-Version:Message-ID:Date:Subject:To:From; bh=kzPX8ifyIvmJS93g/Gi7F4CRB+1iRBScqiuldej9MEM=; b=laXnN+D3C7TllouSdZTcoft67F4NSySjJnYIgkB8a4lNj/zyaIik7PGKNLGxA6sDPsP649WQHUFdT3wOYe/bUDiyAYQmSUgAPPTugabDDfqYSZskeevddX4DnpvKlDhOBZbt12/rNUczVZmiHBXLo1RuiNZLcvyr/i8E3AgjES9vhhA9PqoC4Iu2eVOlndmOIFfC2zTIvW3MjLCsrKxMqBHAtLJWKK94CQpveGOArrVt+KJwDpGuiBCxInBu7drW3UKGDb3GjM/RAocnTRoyliz2GiqXsknxHvK3JtwxoSTdWcx7yXs96ap2SelFDalYVx8WnNfqsq3OE0WuAfr3tA==; Original-Received: from uucp by iustitia.weinholt.se with local-bsmtp (Exim 4.72) (envelope-from ) id 1UyOw2-0006Pe-Li; Sun, 14 Jul 2013 18:14:06 +0200 Original-Received: from weinholt by industria with local (Exim 4.80) (envelope-from ) id 1UyOr2-00056P-7p; Sun, 14 Jul 2013 18:08:56 +0200 X-Hashcash: 1:20:130714:bug-guile@gnu.org::PGDspBnhoqf+sq8s:000000000000000000000000000000000000000000004wSM User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Original-Sender: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.bugs:7211 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hello schemers, bitwise-arithmetic-shift-right from (rnrs) is wrong for ridiculously large shift amounts: scheme@(guile-user)> (import (rnrs)) scheme@(guile-user)> (bitwise-arithmetic-shift-right -2 (+ (greatest-fixnum= ) 1)) $1 =3D -2 The correct result is -1. Tested on an amd64 system with guile-2.0.9.20-10454-dirty. Here are a few more failing cases, if it helps: (bitwise-arithmetic-shift-right -1939573486025768832 1842615318141600354) =3D> =2D112898036 ; *** failed *** ; expected result: -1 (bitwise-arithmetic-shift-right 1344211617424411880 1877595747324902264) =3D> 18 ; *** failed *** ; expected result: 0 (bitwise-arithmetic-shift-right -1152921504606846979 88553614889043251) =3D> =2D513 ; *** failed *** ; expected result: -1 (bitwise-arithmetic-shift-right -870600743868926059 1508151148) =3D> =2D49488 ; *** failed *** ; expected result: -1 Regards, =2D-=20 G=C3=B6ran Weinholt 13 MR. JAKES: I think our economy was based on 14 industrial process. 15 JUSTICE SCALIA: It was based on horses, for 16 Pete's sake. --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iQIcBAEBCgAGBQJR4s0XAAoJEOM+YaLpuMOi9OwP/ApHe0ZvvWYaUWh9Ay3TFoo9 iGMgI8NCcbhqeSUYsDwGdf9PAPr8zzmJEHud7a7ghHgtmGcAOKxYNF2LkzplE+pG ICybtZxkyHvo6Ta71QguUrGR9Ezk7idsdmWvhjMmN0Xz1C9Y5+qdflNcP1uoP8Jq ywfX8VnvLIzjiWgpvfyi+rZnYSDiKgFZOF/RiFSJMppxy5M61rTtSe1gSfZjRq4v FNWZ/zZacXbCWV6/DbTgAgm5olDGlnA4hRBXQJm4l9QTykJxGFmrmRYsNyOmS8ZV kl+WJPP9YE4LehHFtianbinU7eZaRv6ZZMmyqGi41F543i5K9z2vhHAk035b8wj2 BPNehxcMh+EHTMV3sSxh1dVK9Rsyy6YE5em14YeDvUP2BoRlRLFc/e30BuZgUOCM tQ+FQy7m9QjAOqRGf/flmxVxEEqsryx30IKMmlWSHEho+NmPKxRKglhaxNwGA4NB pjqy86r5QZ84wCZ6+SHg+RF036N274xG+q7OX6aQu8GlaWZis+HuXiv9EYv+gebv bg3I/zUOB75PlBgpKkKufRs1/JMH2dVd3y7Yn7hXJs4ysthes2EAvm3ggc+Lwlm9 42xMigY23r0tba2Al7VLhCZ6lHqKTwFWrPxSzmac4u2tCq8wAwP+i1ImYdhgkJqW ZwTuNneINJeQN8WtyipU =4Q6R -----END PGP SIGNATURE----- --=-=-=--