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


View this message in rfc822 format

From: Torsten Bronger <bronger <at> physik.rwth-aachen.de>
To: 25652 <at> debbugs.gnu.org
Subject: bug#25652: 26.0.50; calc says that cos(1 degree) is 0.54
Date: Fri, 10 Feb 2017 07:17:42 +0100
Hallöchen!

Glenn Morris writes:

> npostavs <at> users.sourceforge.net wrote:
>
>> PS: you have "Mail-Followup-To: bug-gnu-emacs <at> gnu.org" in your
>> headers which is wrong, because followups should go to
>> 25652 <at> debbugs.gnu.org, so I ignored that and the "Mail-Copies-To:
>> never" header.
>
> FWIW it's not wrong, in that bug-gnu-emacs <at> gnu.org and
> 25652 <at> debbugs.gnu.org are equivalent, so long as one does not mess
> with the subject or references headers. But the latter is
> definitely better, and personally I would discourage use of MFT in
> general, since it often leads to people getting dropped from the
> reply chain.

I use gmane.org for using this mailing list like a newsgroup.  Sorry
if this causes trouble.  If it is too much, I switch to ordinary
mail, however, gmane really *is* convenient.

> Anyway, what about this:
>
>   Loading /home/bronger/.calc.el (source)...done

This hint was very helpful!  I totally forgot about my calc
customization.  (Well, it is slightly inconsistent that it is read
by emacs -Q but anyway.)  The error-provoking part in it is:

(setq calc-simplify-mode 'units)

You can toggle this in calc mode with "m U".  So "m d m U 1 C m U 1
C" should exhibit the problem.  Note that you have "Deg" active the
whole time.  The manual says about unit simplification:

    The functions sin, cos, and tan with arguments that have angular
    units like rad or arcmin are simplified by converting to base
    units (radians), then evaluating with the angular mode
    temporarily set to radians.

While this explains part of my observations, I find it very
confusing that "1 C" may yield 0.54 while in "Deg" mode.

And, "90 C" always yielding zero is definitely inconsistent.
"89.999 C" yields -0.447984214223 while in unit simplification mode,
so the cosine is not continuous anymore.

Tschö,
Torsten.

-- 
Torsten Bronger





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.