From unknown Sun Aug 17 04:20:40 2025 X-Loop: help-debbugs@gnu.org Subject: bug#19063: [FIX] Calc computing max of a vector of dates Resent-From: Thierry Banel Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 15 Nov 2014 18:07:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 19063 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 19063@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.141607478514103 (code B ref -1); Sat, 15 Nov 2014 18:07:02 +0000 Received: (at submit) by debbugs.gnu.org; 15 Nov 2014 18:06:25 +0000 Received: from localhost ([127.0.0.1]:34076 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xphjs-0003fP-Q7 for submit@debbugs.gnu.org; Sat, 15 Nov 2014 13:06:25 -0500 Received: from eggs.gnu.org ([208.118.235.92]:54904) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xphd5-0003T1-6T for submit@debbugs.gnu.org; Sat, 15 Nov 2014 12:59:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xphcv-0006tv-QN for submit@debbugs.gnu.org; Sat, 15 Nov 2014 12:59:22 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: ** X-Spam-Status: No, score=2.5 required=5.0 tests=BAYES_40,FREEMAIL_FROM, RECEIVED_FROM_WINDOWS_HOST autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:36632) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xphcv-0006tr-NW for submit@debbugs.gnu.org; Sat, 15 Nov 2014 12:59:13 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56593) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xphcp-0006sp-Cx for bug-gnu-emacs@gnu.org; Sat, 15 Nov 2014 12:59:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xphcj-0006t2-6t for bug-gnu-emacs@gnu.org; Sat, 15 Nov 2014 12:59:07 -0500 Received: from smtp1-g21.free.fr ([212.27.42.1]:26436) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xphcj-0006sx-16 for bug-gnu-emacs@gnu.org; Sat, 15 Nov 2014 12:59:01 -0500 Received: from [IPv6:2a01:e35:2e21:def0:5d53:abbc:1d97:8db8] (unknown [IPv6:2a01:e35:2e21:def0:5d53:abbc:1d97:8db8]) by smtp1-g21.free.fr (Postfix) with ESMTP id 72C5194008D for ; Sat, 15 Nov 2014 18:56:39 +0100 (CET) Message-ID: <5467945F.2060609@free.fr> Date: Sat, 15 Nov 2014 18:58:55 +0100 From: Thierry Banel User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: Windows NT kernel [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Mailman-Approved-At: Sat, 15 Nov 2014 13:06:23 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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: -5.0 (-----) Hi the list. * Description In Calc there is a bug when computing the max or min of a vector of dates. The fix is quite simple (change a car to a caar) * Unit testing M-x calc launch Calc t N insert "now" date-time 7+ add 7 days (or whatever) t N insert "now" again Esc 2 v p pack both date-times in a vector u X call calc-vector-max ==> result with the bug: vmax([<7:36:14pm Thu Nov 20, 2014>, <7:36:54pm Thu Nov 13, 2014>]) ==> result with the fix: <7:36:14pm Thu Nov 20, 2014> This test also works with "min" instead of "max" and u N instead of u X * ChangeLog 2014-11-13 Thierry Banel * calc-arith.el (math-max-list, math-min-list): fix bug for date handling. * Patch *** calc-arith.el-old 2014-11-13 19:58:13.159676097 +0100 --- calc-arith.el-new 2014-11-13 20:00:01.886392943 +0100 *************** *** 2249,2255 **** (defun math-min-list (a b) (if b ! (if (or (Math-anglep (car b)) (eq (car b) 'date) (and (eq (car (car b)) 'intv) (math-intv-constp (car b))) (math-infinitep (car b))) (math-min-list (math-min a (car b)) (cdr b)) --- 2249,2255 ---- (defun math-min-list (a b) (if b ! (if (or (Math-anglep (car b)) (eq (caar b) 'date) (and (eq (car (car b)) 'intv) (math-intv-constp (car b))) (math-infinitep (car b))) (math-min-list (math-min a (car b)) (cdr b)) *************** *** 2279,2285 **** (defun math-max-list (a b) (if b ! (if (or (Math-anglep (car b)) (eq (car b) 'date) (and (eq (car (car b)) 'intv) (math-intv-constp (car b))) (math-infinitep (car b))) (math-max-list (math-max a (car b)) (cdr b)) --- 2279,2285 ---- (defun math-max-list (a b) (if b ! (if (or (Math-anglep (car b)) (eq (caar b) 'date) (and (eq (car (car b)) 'intv) (math-intv-constp (car b))) (math-infinitep (car b))) (math-max-list (math-max a (car b)) (cdr b)) From unknown Sun Aug 17 04:20:40 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.503 (Entity 5.503) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Thierry Banel Subject: bug#19063: closed (Fwd: Re: bug#19063: [FIX] Calc computing max of a vector of dates) Message-ID: References: <5467945F.2060609@free.fr> X-Gnu-PR-Message: they-closed 19063 X-Gnu-PR-Package: emacs Reply-To: 19063@debbugs.gnu.org Date: Sun, 16 Nov 2014 05:37:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1416116222-6927-1" This is a multi-part message in MIME format... ------------=_1416116222-6927-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #19063: [FIX] Calc computing max of a vector of dates which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 19063@debbugs.gnu.org. --=20 19063: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D19063 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1416116222-6927-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 19063-done) by debbugs.gnu.org; 16 Nov 2014 05:36:15 +0000 Received: from localhost ([127.0.0.1]:34259 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XpsVS-0001mh-EM for submit@debbugs.gnu.org; Sun, 16 Nov 2014 00:36:14 -0500 Received: from mail-pa0-f41.google.com ([209.85.220.41]:44756) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XpsVP-0001mY-Tk for 19063-done@debbugs.gnu.org; Sun, 16 Nov 2014 00:36:12 -0500 Received: by mail-pa0-f41.google.com with SMTP id rd3so5583232pab.28 for <19063-done@debbugs.gnu.org>; Sat, 15 Nov 2014 21:36:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=Gx6ZOVcAoTx1/MBbABVqZ+lT4+3hKyInPcgJoozzF88=; b=j20oG1lx+/QL1iueH9zs0XhCDVQgcAYABb0lmb9NC+mvEH6NqxKA++xlFYcoryn08r rxqOWOnmSMjEYxTbqr2RjOFJhJpSYOII9XGXi62EehiVJP5e8OOTsVEN0iuCQYhkbtaN GcBrroXmbd1st3qAfQHS6cvD7LjN+y00IcPH92fan5sclsfmMcSCfzGdA8d6ymTnn5qr 7G5dr5B//1Kx9hsufyUCNAgsdo54vfcqwXREEqZByGzr2hCaydmGjm8Z35X7HJwLw8Xs iz2n3iCvpuND1jJwzNelPqzAAhR1yZrzBo3ywMBcydWOb9fnqki2eonT0jGiUudOMsip wvHA== MIME-Version: 1.0 X-Received: by 10.70.53.102 with SMTP id a6mr11383631pdp.70.1416116170866; Sat, 15 Nov 2014 21:36:10 -0800 (PST) Received: by 10.70.26.225 with HTTP; Sat, 15 Nov 2014 21:36:10 -0800 (PST) Received: by 10.70.26.225 with HTTP; Sat, 15 Nov 2014 21:36:10 -0800 (PST) In-Reply-To: <87389jhfxu.fsf@gmail.com> References: <5467945F.2060609@free.fr> <87389jhfxu.fsf@gmail.com> Date: Sat, 15 Nov 2014 23:36:10 -0600 Message-ID: Subject: Fwd: Re: bug#19063: [FIX] Calc computing max of a vector of dates From: Jay Belanger To: 19063-done@debbugs.gnu.org Content-Type: multipart/alternative; boundary=001a11343bc45345d60507f33dca X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 19063-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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.7 (/) --001a11343bc45345d60507f33dca Content-Type: text/plain; charset=UTF-8 ---------- Forwarded message ---------- From: "Jay Belanger" Date: Nov 15, 2014 11:28 PM Subject: Re: bug#19063: [FIX] Calc computing max of a vector of dates To: Cc: Thanks; I've committed your fix. Jay --001a11343bc45345d60507f33dca Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
---------- Forwarded message ----------
From:= "Jay Belanger" <j= ay.p.belanger@gmail.com>
Date: Nov 15, 2014 11:28 PM
Subject: = Re: bug#19063: [FIX] Calc computing max of a vector of dates
To: <done-19063@debbugs.gnu.org&= gt;
Cc: <jay.p.belanger@= gmail.com>


Thanks; I've committed your fix.

Jay
--001a11343bc45345d60507f33dca-- ------------=_1416116222-6927-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 15 Nov 2014 18:06:25 +0000 Received: from localhost ([127.0.0.1]:34076 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xphjs-0003fP-Q7 for submit@debbugs.gnu.org; Sat, 15 Nov 2014 13:06:25 -0500 Received: from eggs.gnu.org ([208.118.235.92]:54904) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xphd5-0003T1-6T for submit@debbugs.gnu.org; Sat, 15 Nov 2014 12:59:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xphcv-0006tv-QN for submit@debbugs.gnu.org; Sat, 15 Nov 2014 12:59:22 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: ** X-Spam-Status: No, score=2.5 required=5.0 tests=BAYES_40,FREEMAIL_FROM, RECEIVED_FROM_WINDOWS_HOST autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:36632) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xphcv-0006tr-NW for submit@debbugs.gnu.org; Sat, 15 Nov 2014 12:59:13 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56593) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xphcp-0006sp-Cx for bug-gnu-emacs@gnu.org; Sat, 15 Nov 2014 12:59:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xphcj-0006t2-6t for bug-gnu-emacs@gnu.org; Sat, 15 Nov 2014 12:59:07 -0500 Received: from smtp1-g21.free.fr ([212.27.42.1]:26436) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xphcj-0006sx-16 for bug-gnu-emacs@gnu.org; Sat, 15 Nov 2014 12:59:01 -0500 Received: from [IPv6:2a01:e35:2e21:def0:5d53:abbc:1d97:8db8] (unknown [IPv6:2a01:e35:2e21:def0:5d53:abbc:1d97:8db8]) by smtp1-g21.free.fr (Postfix) with ESMTP id 72C5194008D for ; Sat, 15 Nov 2014 18:56:39 +0100 (CET) Message-ID: <5467945F.2060609@free.fr> Date: Sat, 15 Nov 2014 18:58:55 +0100 From: Thierry Banel User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 To: bug-gnu-emacs@gnu.org Subject: [FIX] Calc computing max of a vector of dates Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: Windows NT kernel [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Sat, 15 Nov 2014 13:06:23 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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: -5.0 (-----) Hi the list. * Description In Calc there is a bug when computing the max or min of a vector of dates. The fix is quite simple (change a car to a caar) * Unit testing M-x calc launch Calc t N insert "now" date-time 7+ add 7 days (or whatever) t N insert "now" again Esc 2 v p pack both date-times in a vector u X call calc-vector-max ==> result with the bug: vmax([<7:36:14pm Thu Nov 20, 2014>, <7:36:54pm Thu Nov 13, 2014>]) ==> result with the fix: <7:36:14pm Thu Nov 20, 2014> This test also works with "min" instead of "max" and u N instead of u X * ChangeLog 2014-11-13 Thierry Banel * calc-arith.el (math-max-list, math-min-list): fix bug for date handling. * Patch *** calc-arith.el-old 2014-11-13 19:58:13.159676097 +0100 --- calc-arith.el-new 2014-11-13 20:00:01.886392943 +0100 *************** *** 2249,2255 **** (defun math-min-list (a b) (if b ! (if (or (Math-anglep (car b)) (eq (car b) 'date) (and (eq (car (car b)) 'intv) (math-intv-constp (car b))) (math-infinitep (car b))) (math-min-list (math-min a (car b)) (cdr b)) --- 2249,2255 ---- (defun math-min-list (a b) (if b ! (if (or (Math-anglep (car b)) (eq (caar b) 'date) (and (eq (car (car b)) 'intv) (math-intv-constp (car b))) (math-infinitep (car b))) (math-min-list (math-min a (car b)) (cdr b)) *************** *** 2279,2285 **** (defun math-max-list (a b) (if b ! (if (or (Math-anglep (car b)) (eq (car b) 'date) (and (eq (car (car b)) 'intv) (math-intv-constp (car b))) (math-infinitep (car b))) (math-max-list (math-max a (car b)) (cdr b)) --- 2279,2285 ---- (defun math-max-list (a b) (if b ! (if (or (Math-anglep (car b)) (eq (caar b) 'date) (and (eq (car (car b)) 'intv) (math-intv-constp (car b))) (math-infinitep (car b))) (math-max-list (math-max a (car b)) (cdr b)) ------------=_1416116222-6927-1--