GNU bug report logs - #25652
26.0.50; [calc] In Units Simplication + Degree mode cos(1 deg) != cos(1)

Previous Next

Package: emacs;

Reported by: Torsten Bronger <bronger <at> physik.rwth-aachen.de>

Date: Wed, 8 Feb 2017 07:39:02 UTC

Severity: normal

Tags: confirmed

Found in version 26.0.50

Done: Tino Calancha <tino.calancha <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #50 received at 25652 <at> debbugs.gnu.org (full text, mbox):

From: npostavs <at> users.sourceforge.net
To: Tino Calancha <tino.calancha <at> gmail.com>
Cc: 25652 <at> debbugs.gnu.org
Subject: Re: bug#25652: 26.0.50; calc says that cos(1 degree) is 0.54
Date: Wed, 17 May 2017 23:32:12 -0400
Tino Calancha <tino.calancha <at> gmail.com> writes:

> Yes, my commit produced this bug.  We must revert it.  Sorry for that.
> That commit was to fix Bug#23889.  It would be nice if we can fix Bug#23889 in
> a new way.
> In that bug the problem was that, if the user inputs a symbolic expression containning
> an angle unit, then this unit is overriden by calc-angle-mode while simplifying such
> expression.
> That should not happen as mentioned in the manual:
> (info "(calc) Trigonometric and Hyperbolic Functions")
>
> That is,
> M-x calc RET
> m d ; Set calc-angle-mode to degrees.
> ' sin (45 deg) RET
> u s ; Must insert the value of:  (sin (* 45 pi (/ 180.0)))
> ;; But instead, inserts the value of: (sin (* 45 (expt (/ pi 180.0) 2)))
> ;; i.e., it's applying (/ pi 180) twice.
>
> I have updated the patch:
> 1) Revert 713e922243
>
> 2) Bind calc-angle-mode to 'rad while simplifying an expression whenever such
> expression contains an unit angle.  This way, hopefully, the second factor (/ pi 180)
> won't be applied.
>
> Opinions, comments...

I'm not familiar enough with calc to say if this is a good idea or not,
but I guess you may as well push this now so that we can discover if it
has any problems sooner rather than later.




This bug report was last modified 8 years and 64 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.