bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#25652: 26.0.50; calc says that cos(1 degree) is 0.54


From: npostavs
Subject: bug#25652: 26.0.50; calc says that cos(1 degree) is 0.54
Date: Wed, 17 May 2017 23:32:12 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux)

Tino Calancha <tino.calancha@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.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]