GNU bug report logs -
#25652
26.0.50; [calc] In Units Simplication + Degree mode cos(1 deg) != cos(1)
Previous Next
Full log
Message #55 received at 25652-done <at> debbugs.gnu.org (full text, mbox):
npostavs <at> users.sourceforge.net writes:
> 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.
Thank you. I've reverted my buggy fix, and pushed a new fix
for Bug#23889 into master:
Revert:
eab1a6307b09180bd775cfb6bf7330eb5367bbe0
Fix:
c48e539226a062d01b8d5534644fae959506a743
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.