[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: |
Tino Calancha |
Subject: |
bug#25652: 26.0.50; calc says that cos(1 degree) is 0.54 |
Date: |
Thu, 18 May 2017 14:51:46 +0900 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) |
npostavs@users.sourceforge.net writes:
> 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.
Thank you. I've reverted my buggy fix, and pushed a new fix
for Bug#23889 into master:
Revert:
eab1a6307b09180bd775cfb6bf7330eb5367bbe0
Fix:
c48e539226a062d01b8d5534644fae959506a743