From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gerd =?UTF-8?Q?M=C3=B6llmann?= Newsgroups: gmane.emacs.bugs Subject: bug#66696: 29.1; "A bug in the function debug." Date: Mon, 23 Oct 2023 21:11:55 +0200 Message-ID: References: <556885424.775162.1698086427787.ref@mail.yahoo.com> <556885424.775162.1698086427787@mail.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6865"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 66696@debbugs.gnu.org To: Lewis Creary Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Oct 23 21:13:01 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qv0MH-0001bJ-7w for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 23 Oct 2023 21:13:01 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qv0Lt-0001XG-8s; Mon, 23 Oct 2023 15:12:37 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qv0Lr-0001WS-8b for bug-gnu-emacs@gnu.org; Mon, 23 Oct 2023 15:12:35 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qv0Lq-00029T-EL for bug-gnu-emacs@gnu.org; Mon, 23 Oct 2023 15:12:35 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qv0MI-0001Xw-4y for bug-gnu-emacs@gnu.org; Mon, 23 Oct 2023 15:13:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Gerd =?UTF-8?Q?M=C3=B6llmann?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 23 Oct 2023 19:13:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66696 X-GNU-PR-Package: emacs Original-Received: via spool by 66696-submit@debbugs.gnu.org id=B66696.16980883605908 (code B ref 66696); Mon, 23 Oct 2023 19:13:02 +0000 Original-Received: (at 66696) by debbugs.gnu.org; 23 Oct 2023 19:12:40 +0000 Original-Received: from localhost ([127.0.0.1]:51708 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qv0Lw-0001XE-AP for submit@debbugs.gnu.org; Mon, 23 Oct 2023 15:12:40 -0400 Original-Received: from mail-ed1-x52f.google.com ([2a00:1450:4864:20::52f]:56336) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qv0Lp-0001Wh-GU for 66696@debbugs.gnu.org; Mon, 23 Oct 2023 15:12:36 -0400 Original-Received: by mail-ed1-x52f.google.com with SMTP id 4fb4d7f45d1cf-52bd9ddb741so5648685a12.0 for <66696@debbugs.gnu.org>; Mon, 23 Oct 2023 12:12:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698088318; x=1698693118; darn=debbugs.gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=WlmeIkF8bL4sQLqyk3A+Vz+K7hYiQ0iNCXaNBf34uZs=; b=TYick071TE6Ak0Mfk7Z+ImuYzisOphbOANZ4en7jPJnAwf1FSJTM+kMeqUMdAp37pI FbqIW6yXQdptw58ih3SwhTLaZ1G7qa2OcjRCCnfmkzxdQXhJtLwZ4E2hIKBPq0R9M/hR EKlJXbdtLPm6JI/aNTQgy46aNZU0NGRRZqaF4qOe7j0jq0YRxgRQAJzoqEbPKsrsbzuy eUzjFCRurqgssPxr9WuhHC1qi6yzG4r2yKOUcqccIOiItQdSM0n/kPCmUlOTbZei0WXn 8X57YzCNKp1BaC4HvJlpRpVPb+ADehrGq5rau6BoXzCvXoySkgA4uZSazzdUzJeqB/x5 Q5xw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698088318; x=1698693118; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=WlmeIkF8bL4sQLqyk3A+Vz+K7hYiQ0iNCXaNBf34uZs=; b=YImW0qn8BmAPYpV3B9Y0Zuj+qxr5kX+IgFSJte5fetc2vM057qHSNevSVL3bcSMe52 5clYnnxcjE5WnYvoYZG6Mbdalblspdcsi8/wRotY05/SC2RS+DS4yLDlKU5h3geiMYNf ujB3NggXRDcbYqzB4vdgKXQH54O66xm8xNFzqRbwzZIWHSBlkNDI0cb3/VvJ79muaLhR RxKv+Bcd7f+EAQ7BUwX9cQJZ0OM9E/LrQiSnB8UASBzcHDgyXFYrA2O+0Q7PlWFUslCx wPAhv/CKabTRvXn43/71qMl7Xyx1f+QLQ0cksnY7ysJvwJYyBhdwX/s8dFoTpdzb+PIz evoA== X-Gm-Message-State: AOJu0Ywb6bGbO1PGg1j7AHdf9pTEm9+TtEvv0CH1CXm+1xHkBka2A5ns lNIwpHlg1kxCoNt0f9TO75Gru01VK4c= X-Google-Smtp-Source: AGHT+IHZZgoo6LypjmBfT2T1NIvKHEniH3fhwMFo5y14IUxZrXXT5J3K0v2rioZSBhV9D2lmzxGm/g== X-Received: by 2002:a50:cd95:0:b0:53d:ea81:d021 with SMTP id p21-20020a50cd95000000b0053dea81d021mr7369074edi.37.1698088317808; Mon, 23 Oct 2023 12:11:57 -0700 (PDT) Original-Received: from Pro.fritz.box (pd9e3686e.dip0.t-ipconnect.de. [217.227.104.110]) by smtp.gmail.com with ESMTPSA id r30-20020a50c01e000000b00535204ffdb4sm6855558edb.72.2023.10.23.12.11.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Oct 2023 12:11:57 -0700 (PDT) In-Reply-To: <556885424.775162.1698086427787@mail.yahoo.com> (Lewis Creary's message of "Mon, 23 Oct 2023 18:40:27 +0000 (UTC)") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:273050 Archived-At: Lewis Creary writes: (Please reply to all, so that your mails get to the bug tracker.) >>> Did you get your parentheses right? The above ')' is the end of the while. > > I checked, and the extra parenthesis is in my bug report, but not in the code I tried to run. I'd be interested to know if you can reproduce my > problem in emacs lisp, with correct parentheses. > > -- Lew Creary 1: (while ((and (>= dividend 0) (not stop-sw))) 2: (setq dividend (/ dividend 2) 3: rmdr-list (append (list (% dividend 2)) rmdr-list) ) You write in the bug report that you start with dividend being 5, and you expect the first element of the list to be 1, but it is 0. When you look at line 2, dividend is divided by 2, which results in 5 / 2 = 2, because this is integer division. In line 3, you compute the rest of dividend (which is now 2) when divided by 2, which results in 0. So, this looks correct.