From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Newsgroups: gmane.emacs.bugs Subject: bug#41925: 28.0.50; Error using calc-degrees-mode with calc-base-units Date: Sat, 20 Jun 2020 18:09:27 +0200 Message-ID: <6E1D5605-E61F-4E96-899A-77A6AC8AB5ED@acm.org> References: <87pn9x7aoz.fsf@free.fr> Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.14\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="88067"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 41925@debbugs.gnu.org To: Julien Cubizolles Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jun 20 18:10:12 2020 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 1jmg4H-000MkZ-TN for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 20 Jun 2020 18:10:10 +0200 Original-Received: from localhost ([::1]:36438 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jmg4G-0004DQ-BQ for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 20 Jun 2020 12:10:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40216) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jmg4A-0004C7-8v for bug-gnu-emacs@gnu.org; Sat, 20 Jun 2020 12:10:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:47105) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jmg49-0001jA-WA for bug-gnu-emacs@gnu.org; Sat, 20 Jun 2020 12:10:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jmg49-0005ZJ-QI for bug-gnu-emacs@gnu.org; Sat, 20 Jun 2020 12:10:01 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: <87pn9x7aoz.fsf@free.fr> Resent-From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 20 Jun 2020 16:10:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41925 X-GNU-PR-Package: emacs Original-Received: via spool by 41925-submit@debbugs.gnu.org id=B41925.159266937621367 (code B ref 41925); Sat, 20 Jun 2020 16:10:01 +0000 Original-Received: (at 41925) by debbugs.gnu.org; 20 Jun 2020 16:09:36 +0000 Original-Received: from localhost ([127.0.0.1]:58651 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jmg3k-0005YZ-11 for submit@debbugs.gnu.org; Sat, 20 Jun 2020 12:09:36 -0400 Original-Received: from mail78c50.megamailservers.eu ([91.136.10.88]:40384 helo=mail70c50.megamailservers.eu) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jmg3g-0005YN-1F for 41925@debbugs.gnu.org; Sat, 20 Jun 2020 12:09:34 -0400 X-Authenticated-User: mattiase@bredband.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1592669370; bh=I6mAzmPIBe0NtMm8Ooqd8W8kht9Mg6U5XAzs8WQjWbM=; h=From:Subject:Date:Cc:To:From; b=qk5+Iaa6QZHWt4VZfvt+Jcl+iZnLd8cb8PupQKHuKY2T+gxscnWs0NBeMgfVcxxO+ tWfSplTXW6DiKrwzJ8HcaH981Zb7ir9+cvqCPcaqMYaq7pm2HX3qrCTs55boaEjbvw KcV2ECA72YaTAxiTqGhUU6c4uqWO4iQOxayw/l3E= Feedback-ID: mattiase@acm.or Original-Received: from [192.168.0.4] (c188-150-171-71.bredband.comhem.se [188.150.171.71]) (authenticated bits=0) by mail70c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id 05KG9SDD003259; Sat, 20 Jun 2020 16:09:29 +0000 X-Mailer: Apple Mail (2.3445.104.14) X-CTCH-RefID: str=0001.0A782F20.5EEE3421.005E, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 X-CTCH-VOD: Unknown X-CTCH-Spam: Unknown X-CTCH-Score: 0.000 X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-CSC: 0 X-CHA: v=2.3 cv=OKBZIhSB c=1 sm=1 tr=0 a=SF+I6pRkHZhrawxbOkkvaA==:117 a=SF+I6pRkHZhrawxbOkkvaA==:17 a=IkcTkHD0fZMA:10 a=VF7Ow1OpVmoA:10 a=M51BFTxLslgA:10 a=CUW0FxpPLF7tKjO4kpAA:9 a=QEXdDO2ut3YA:10 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" Xref: news.gmane.io gmane.emacs.bugs:182209 Archived-At: It looks like Calc explicitly switches to radians mode during = simplification with units: (defun math-from-radians (a) ; [N N] (cond ((and (not math-simplifying-units) (eq calc-angle-mode 'deg)) (if (math-constp a) (math-div a (math-pi-over-180)) (list 'calcFunc-deg a))) ((eq calc-angle-mode 'hms) (math-to-hms a 'rad)) (t a))) Presumably, this is done because the unit calculations somehow expect = everything to be done in radians. I'm not sure how the machinery works, = but to hazard a guess, suppose that sin(30 deg) would unit-simplify into sin(30*(=CF=80/180)) then that would only give the right result if sin(x) only accepted = radians no matter the current angle mode during this simplification = process. Obviously I didn't write Calc, and am not sure how to solve it without = blowing something else apart. Perhaps you want to give it a go? It also seems unclear how units and angle mode are supposed to interact. = In degrees mode, arctan(1) evaluates to a dimensionless 45, not 45 deg.