From debbugs-submit-bounces@debbugs.gnu.org Sat Mar 18 19:45:43 2017 Received: (at submit) by debbugs.gnu.org; 18 Mar 2017 23:45:43 +0000 Received: from localhost ([127.0.0.1]:34409 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cpO2Z-0005ZT-6T for submit@debbugs.gnu.org; Sat, 18 Mar 2017 19:45:43 -0400 Received: from eggs.gnu.org ([208.118.235.92]:60923) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cpO2X-0005ZG-4R for submit@debbugs.gnu.org; Sat, 18 Mar 2017 19:45:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cpO2R-0007Wj-7C for submit@debbugs.gnu.org; Sat, 18 Mar 2017 19:45:35 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,LOTS_OF_MONEY, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:58318) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cpO2R-0007Wb-4J for submit@debbugs.gnu.org; Sat, 18 Mar 2017 19:45:35 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51873) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cpO2Q-0004wA-1S for bug-guile@gnu.org; Sat, 18 Mar 2017 19:45:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cpO2P-0007Vy-C3 for bug-guile@gnu.org; Sat, 18 Mar 2017 19:45:34 -0400 Received: from river6.fysh.org ([2001:41d0:d:20da::2]:58278 helo=river.fysh.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cpO2P-0007VS-33 for bug-guile@gnu.org; Sat, 18 Mar 2017 19:45:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=fysh.org; s=20170316; h=Content-Type:MIME-Version:Message-ID:Subject:To:From:Date; bh=3o/Y5wBhaCXkdrtUwFHZSb37IZEiVXnq3ruHkYA51f4=; b=Akhfir+hhtudSxvMl0lVgXfIOT8h/t4TVAMTleuXr1/zZPImf/HdQaoOGlzQaqPoO8vEH37rVmeCds8ldf/J3XnOGtrslemirUb4ZD6q9BHp0ikimavJeFYUzyUtUtu6hHwcp2KmphnSleRHWAszYz8TgYkMrT2s4C9dCtCh23k=; Received: from zefram by river.fysh.org with local (Exim 4.84_2 #1 (Debian)) id 1cpO2K-00079B-J0; Sat, 18 Mar 2017 23:45:28 +0000 Date: Sat, 18 Mar 2017 23:45:28 +0000 From: Zefram To: bug-guile@gnu.org Subject: date-week-day screws up prior to AD 1 Message-ID: <20170318234528.GL6518@fysh.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) Looking at day of the week, via SRFI-19's date-week-day: scheme@(guile-user)> (use-modules (srfi srfi-19)) scheme@(guile-user)> (julian-day->date 1721426 0) $1 = # scheme@(guile-user)> (date-week-day (julian-day->date 1721426 0)) $2 = 1 scheme@(guile-user)> (date-week-day (julian-day->date 1721425 0)) $3 = 6 The output for 0001-01-01, Monday, is correct. The preceding day is actually a Sunday, but Saturday was shown. Looking at the code, this bug arises for the same reason as the problem with date-year-day raised in bug#26151. The date-year value, of the weird zero-skipping year numbering, is passed to an algorithm that obviously expects astronomical year numbering. Looking at the code also reveals a second problem: the algorithm is written to perform divisions with quotient where it obviously needs modulo. This will manifest in erroneous computations for some earlier years once the above is fixed. -zefram From debbugs-submit-bounces@debbugs.gnu.org Sat Mar 18 21:01:46 2017 Received: (at 26165) by debbugs.gnu.org; 19 Mar 2017 01:01:46 +0000 Received: from localhost ([127.0.0.1]:34426 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cpPEA-0007RS-FI for submit@debbugs.gnu.org; Sat, 18 Mar 2017 21:01:46 -0400 Received: from river.fysh.org ([87.98.248.19]:35122 ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cpPE8-0007RJ-90 for 26165@debbugs.gnu.org; Sat, 18 Mar 2017 21:01:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=fysh.org; s=20170316; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:To:From:Date; bh=e5alUco+lILZeTo7Gm9Kp/FJPvsbVW8/s0qnAmhc4VQ=; b=Vyn5oFGyZGuMNbFnG9kGpiP5YV59t/VkNfDU/Yn0rgAIGrWJh4TQINrtbhYSPFCamtEpBUZABF7pHRf3XhPxdPHiM+wjGDKsSQgaeBOALClmrP+N+LTe/zNT1T9Vx7Rg73ZsZCEEWvxAl5mj9APuDbaaZP9V2DM5K+rlJr/Or4I=; Received: from zefram by river.fysh.org with local (Exim 4.84_2 #1 (Debian)) id 1cpPE4-0001CG-Ea; Sun, 19 Mar 2017 01:01:40 +0000 Date: Sun, 19 Mar 2017 01:01:40 +0000 From: Zefram To: 26165@debbugs.gnu.org Subject: Re: bug#26165: date-week-day screws up prior to AD 1 Message-ID: <20170319010140.GA3504@fysh.org> References: <20170318234528.GL6518@fysh.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170318234528.GL6518@fysh.org> X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 26165 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) I wrote: >written to perform divisions with quotient where it obviously needs >modulo. Oops, thinko there. It needs floor-quotient, the quotient-like function that uses floor rounding. modulo is the *remainder*-like function that uses floor rounding. -zefram From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 21 16:41:27 2018 Received: (at 26165-done) by debbugs.gnu.org; 21 Oct 2018 20:41:27 +0000 Received: from localhost ([127.0.0.1]:34616 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gEKXP-0006Ac-CF for submit@debbugs.gnu.org; Sun, 21 Oct 2018 16:41:27 -0400 Received: from world.peace.net ([64.112.178.59]:59812) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gEKXN-0006AO-O2 for 26165-done@debbugs.gnu.org; Sun, 21 Oct 2018 16:41:26 -0400 Received: from mhw by world.peace.net with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1gEKXI-0001kk-1e; Sun, 21 Oct 2018 16:41:20 -0400 From: Mark H Weaver To: Zefram Subject: Re: bug#26165: date-week-day screws up prior to AD 1 References: <20170318234528.GL6518@fysh.org> Date: Sun, 21 Oct 2018 16:41:06 -0400 In-Reply-To: <20170318234528.GL6518@fysh.org> (Zefram's message of "Sat, 18 Mar 2017 23:45:28 +0000") Message-ID: <87o9bnyqvx.fsf@netris.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 26165-done Cc: 26165-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Zefram writes: > Looking at day of the week, via SRFI-19's date-week-day: > > scheme@(guile-user)> (use-modules (srfi srfi-19)) > scheme@(guile-user)> (julian-day->date 1721426 0) > $1 = # > scheme@(guile-user)> (date-week-day (julian-day->date 1721426 0)) > $2 = 1 > scheme@(guile-user)> (date-week-day (julian-day->date 1721425 0)) > $3 = 6 > > The output for 0001-01-01, Monday, is correct. The preceding day is > actually a Sunday, but Saturday was shown. Looking at the code, this > bug arises for the same reason as the problem with date-year-day raised > in bug#26151. This is fixed by commit a58c7abd72648f77e4ede5f62a2c4e7969bb7f95 on the stable-2.2 branch. I'm closing this bug now, but please reopen if appropriate. Thanks! Mark From unknown Sun Jun 15 08:40:44 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 19 Nov 2018 12:24:07 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator