* bug#25652: 26.0.50; calc says that cos(1 degree) is 0.54 @ 2017-02-08 7:37 Torsten Bronger 2017-02-08 17:39 ` Eli Zaretskii ` (3 more replies) 0 siblings, 4 replies; 15+ messages in thread From: Torsten Bronger @ 2017-02-08 7:37 UTC (permalink / raw) To: 25652 In Emacs calc usind degree mode, cos(1) results in 0.540302305868 instead of 0.999847695156. In GNU Emacs 26.0.50.3 (x86_64-pc-linux-gnu) of 2017-02-08 built on wilson Repository revision: c8ee570a8be7afaae3ea318b9d7dbffb62a7bbd0 Windowing system distributor 'The X.Org Foundation', version 11.0.11804000 System Description: Ubuntu 16.04.1 LTS Recent messages: Mark set [2 times] Saving file /home/bronger/src/totorio/certbot/certbot_master.py... Wrote /home/bronger/src/totorio/certbot/certbot_master.py C-c * is undefined C-x * (Type ? for a list of Calc options) Loading /home/bronger/.calc.el (source)...done Welcome to the GNU Emacs Calculator! Press ‘?’ or ‘h’ for help, ‘q’ to quit Working... [2 times] Angles measured in radians Working... Configured using: 'configure --prefix=/usr/local/ --mandir=/usr/local/share/man/ --infodir=/usr/local/share/info/ --with-x-toolkit=no --without-makeinfo --with-xpm --with-jpeg --with-tiff --with-gif --with-png --with-x' Configured features: XPM JPEG TIFF GIF PNG RSVG SOUND DBUS GSETTINGS NOTIFY GNUTLS LIBXML2 FREETYPE XFT ZLIB X11 Important settings: value of $EMACSLOADPATH: /home/bronger/.emacs.d/lisp: value of $LANG: de_DE.UTF-8 locale-coding-system: utf-8-unix Major mode: Calculator Minor modes in effect: diff-auto-refine-mode: t shell-dirtrack-mode: t global-auto-revert-mode: t savehist-mode: t desktop-save-mode: t global-eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t global-font-lock-mode: t font-lock-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t buffer-read-only: t line-number-mode: t Load-path shadows: /home/bronger/.emacs.d/lisp/visual-basic-mode hides /home/bronger/.emacs.d/lisp/nxhtml/related/visual-basic-mode /home/bronger/.emacs.d/lisp/yasnippet/snippets/fundamental-mode/.yas-setup hides /home/bronger/.emacs.d/lisp/yasnippet/snippets/prog-mode/.yas-setup /home/bronger/.emacs.d/lisp/yasnippet/snippets/fundamental-mode/.yas-setup hides /home/bronger/.emacs.d/lisp/yasnippet/snippets/python-mode/.yas-setup /home/bronger/.emacs.d/lisp/yasnippet/snippets/fundamental-mode/.yas-setup hides /home/bronger/.emacs.d/lisp/yasnippet/yasmate/snippets/html-mode/.yas-setup /home/bronger/.emacs.d/lisp/yasnippet/snippets/fundamental-mode/.yas-setup hides /home/bronger/.emacs.d/lisp/yasnippet/yasmate/snippets/objc-mode/.yas-setup /home/bronger/.emacs.d/lisp/yasnippet/yasmate/snippets/html-mode/.yasmate-extra-substitutions hides /home/bronger/.emacs.d/lisp/yasnippet/yasmate/snippets/rails-mode/.yasmate-extra-substitutions /home/bronger/.emacs.d/lisp/yasnippet/snippets/fundamental-mode/.yas-setup hides /home/bronger/.emacs.d/lisp/yasnippet/yasmate/snippets/rails-mode/.yas-setup /home/bronger/.emacs.d/lisp/yasnippet/yasmate/snippets/html-mode/.yasmate-extra-substitutions hides /home/bronger/.emacs.d/lisp/yasnippet/yasmate/snippets/ruby-mode/.yasmate-extra-substitutions /home/bronger/.emacs.d/lisp/yasnippet/snippets/fundamental-mode/.yas-setup hides /home/bronger/.emacs.d/lisp/yasnippet/yasmate/snippets/ruby-mode/.yas-setup /home/bronger/.emacs.d/lisp/mmm/mmm-noweb hides /usr/local/share/emacs/site-lisp/mmm-noweb /home/bronger/.emacs.d/lisp/po-mode hides /usr/local/share/emacs/site-lisp/po-mode /home/bronger/.emacs.d/lisp/mmm/mmm-erb hides /usr/local/share/emacs/site-lisp/mmm-erb /home/bronger/.emacs.d/lisp/browse-kill-ring hides /usr/local/share/emacs/site-lisp/browse-kill-ring /home/bronger/.emacs.d/lisp/mmm/mmm-vars hides /usr/local/share/emacs/site-lisp/mmm-vars /home/bronger/.emacs.d/lisp/mmm/mmm-cweb hides /usr/local/share/emacs/site-lisp/mmm-cweb /home/bronger/.emacs.d/lisp/mmm/mmm-auto hides /usr/local/share/emacs/site-lisp/mmm-auto /home/bronger/.emacs.d/lisp/mmm/mmm-rpm hides /usr/local/share/emacs/site-lisp/mmm-rpm /home/bronger/.emacs.d/lisp/mmm/mmm-univ hides /usr/local/share/emacs/site-lisp/mmm-univ /home/bronger/.emacs.d/lisp/mmm/mmm-mode hides /usr/local/share/emacs/site-lisp/mmm-mode /home/bronger/.emacs.d/lisp/mmm/mmm-sample hides /usr/local/share/emacs/site-lisp/mmm-sample /home/bronger/.emacs.d/lisp/mmm/mmm-region hides /usr/local/share/emacs/site-lisp/mmm-region /home/bronger/.emacs.d/lisp/mmm/mmm-class hides /usr/local/share/emacs/site-lisp/mmm-class /home/bronger/.emacs.d/lisp/auctex hides /usr/local/share/emacs/site-lisp/auctex /home/bronger/.emacs.d/lisp/mmm/mmm-cmds hides /usr/local/share/emacs/site-lisp/mmm-cmds /home/bronger/.emacs.d/lisp/mmm/mmm-compat hides /usr/local/share/emacs/site-lisp/mmm-compat /home/bronger/.emacs.d/lisp/mmm/mmm-utils hides /usr/local/share/emacs/site-lisp/mmm-utils /home/bronger/.emacs.d/lisp/mmm/mmm-mason hides /usr/local/share/emacs/site-lisp/mmm-mason /home/bronger/.emacs.d/lisp/mmm/mmm-myghty hides /usr/local/share/emacs/site-lisp/mmm-myghty /home/bronger/.emacs.d/lisp/tex-site hides /usr/local/share/emacs/site-lisp/tex-site /home/bronger/.emacs.d/lisp/preview-latex hides /usr/local/share/emacs/site-lisp/preview-latex /home/bronger/.emacs.d/lisp/bbdb/bbdb-xemacs hides /usr/local/share/emacs/site-lisp/bbdb/bbdb-xemacs /home/bronger/.emacs.d/lisp/bbdb/bbdb hides /usr/local/share/emacs/site-lisp/bbdb/bbdb /home/bronger/.emacs.d/lisp/bbdb/bbdb-whois hides /usr/local/share/emacs/site-lisp/bbdb/bbdb-whois /home/bronger/.emacs.d/lisp/bbdb/bbdb-gnus hides /usr/local/share/emacs/site-lisp/bbdb/bbdb-gnus /home/bronger/.emacs.d/lisp/bbdb/bbdb-sc hides /usr/local/share/emacs/site-lisp/bbdb/bbdb-sc /home/bronger/.emacs.d/lisp/bbdb/bbdb-merge hides /usr/local/share/emacs/site-lisp/bbdb/bbdb-merge /home/bronger/.emacs.d/lisp/bbdb/bbdb-autoloads hides /usr/local/share/emacs/site-lisp/bbdb/bbdb-autoloads /home/bronger/.emacs.d/lisp/bbdb/bbdb-hooks hides /usr/local/share/emacs/site-lisp/bbdb/bbdb-hooks /home/bronger/.emacs.d/lisp/bbdb/bbdb-com hides /usr/local/share/emacs/site-lisp/bbdb/bbdb-com /home/bronger/.emacs.d/lisp/bbdb/bbdb-print hides /usr/local/share/emacs/site-lisp/bbdb/bbdb-print /home/bronger/.emacs.d/lisp/bbdb/bbdb-migrate hides /usr/local/share/emacs/site-lisp/bbdb/bbdb-migrate /home/bronger/.emacs.d/lisp/bbdb/bbdb-reportmail hides /usr/local/share/emacs/site-lisp/bbdb/bbdb-reportmail /home/bronger/.emacs.d/lisp/bbdb/bbdb-vm hides /usr/local/share/emacs/site-lisp/bbdb/bbdb-vm /home/bronger/.emacs.d/lisp/bbdb/bbdb-gui hides /usr/local/share/emacs/site-lisp/bbdb/bbdb-gui /home/bronger/.emacs.d/lisp/bbdb/bbdb-ftp hides /usr/local/share/emacs/site-lisp/bbdb/bbdb-ftp /home/bronger/.emacs.d/lisp/bbdb/bbdb-w3 hides /usr/local/share/emacs/site-lisp/bbdb/bbdb-w3 /home/bronger/.emacs.d/lisp/bbdb/bbdb-srv hides /usr/local/share/emacs/site-lisp/bbdb/bbdb-srv /home/bronger/.emacs.d/lisp/bbdb/bbdb-snarf hides /usr/local/share/emacs/site-lisp/bbdb/bbdb-snarf /home/bronger/.emacs.d/lisp/bbdb/bbdb-rmail hides /usr/local/share/emacs/site-lisp/bbdb/bbdb-rmail /home/bronger/.emacs.d/lisp/bbdb/bbdb-mhe hides /usr/local/share/emacs/site-lisp/bbdb/bbdb-mhe /home/bronger/.emacs.d/lisp/w3m/w3m-cookie hides /usr/local/share/emacs/site-lisp/w3m/w3m-cookie /home/bronger/.emacs.d/lisp/w3m/w3m-bug hides /usr/local/share/emacs/site-lisp/w3m/w3m-bug /home/bronger/.emacs.d/lisp/w3m/bookmark-w3m hides /usr/local/share/emacs/site-lisp/w3m/bookmark-w3m /home/bronger/.emacs.d/lisp/w3m/w3m-symbol hides /usr/local/share/emacs/site-lisp/w3m/w3m-symbol /home/bronger/.emacs.d/lisp/w3m/w3m-bookmark hides /usr/local/share/emacs/site-lisp/w3m/w3m-bookmark /home/bronger/.emacs.d/lisp/w3m/w3m-mail hides /usr/local/share/emacs/site-lisp/w3m/w3m-mail /home/bronger/.emacs.d/lisp/w3m/w3m-session hides /usr/local/share/emacs/site-lisp/w3m/w3m-session /home/bronger/.emacs.d/lisp/w3m/w3m-lnum hides /usr/local/share/emacs/site-lisp/w3m/w3m-lnum /home/bronger/.emacs.d/lisp/w3m/w3m-util hides /usr/local/share/emacs/site-lisp/w3m/w3m-util /home/bronger/.emacs.d/lisp/w3m/w3m hides /usr/local/share/emacs/site-lisp/w3m/w3m /home/bronger/.emacs.d/lisp/w3m/w3m-search hides /usr/local/share/emacs/site-lisp/w3m/w3m-search /home/bronger/.emacs.d/lisp/w3m/w3m-image hides /usr/local/share/emacs/site-lisp/w3m/w3m-image /home/bronger/.emacs.d/lisp/w3m/w3m-load hides /usr/local/share/emacs/site-lisp/w3m/w3m-load /home/bronger/.emacs.d/lisp/w3m/w3m-dtree hides /usr/local/share/emacs/site-lisp/w3m/w3m-dtree /home/bronger/.emacs.d/lisp/w3m/w3m-ccl hides /usr/local/share/emacs/site-lisp/w3m/w3m-ccl /home/bronger/.emacs.d/lisp/w3m/w3m-weather hides /usr/local/share/emacs/site-lisp/w3m/w3m-weather /home/bronger/.emacs.d/lisp/w3m/w3m-tabmenu hides /usr/local/share/emacs/site-lisp/w3m/w3m-tabmenu /home/bronger/.emacs.d/lisp/w3m/w3m-form hides /usr/local/share/emacs/site-lisp/w3m/w3m-form /home/bronger/.emacs.d/lisp/w3m/w3m-perldoc hides /usr/local/share/emacs/site-lisp/w3m/w3m-perldoc /home/bronger/.emacs.d/lisp/w3m/w3m-namazu hides /usr/local/share/emacs/site-lisp/w3m/w3m-namazu /home/bronger/.emacs.d/lisp/w3m/w3m-rss hides /usr/local/share/emacs/site-lisp/w3m/w3m-rss /home/bronger/.emacs.d/lisp/w3m/w3m-favicon hides /usr/local/share/emacs/site-lisp/w3m/w3m-favicon /home/bronger/.emacs.d/lisp/w3m/mime-w3m hides /usr/local/share/emacs/site-lisp/w3m/mime-w3m /home/bronger/.emacs.d/lisp/w3m/w3m-antenna hides /usr/local/share/emacs/site-lisp/w3m/w3m-antenna /home/bronger/.emacs.d/lisp/w3m/w3m-hist hides /usr/local/share/emacs/site-lisp/w3m/w3m-hist /home/bronger/.emacs.d/lisp/w3m/w3m-filter hides /usr/local/share/emacs/site-lisp/w3m/w3m-filter /home/bronger/.emacs.d/lisp/w3m/w3m-proc hides /usr/local/share/emacs/site-lisp/w3m/w3m-proc /home/bronger/.emacs.d/lisp/w3m/octet hides /usr/local/share/emacs/site-lisp/w3m/octet /home/bronger/.emacs.d/lisp/w3m/w3m-ucs hides /usr/local/share/emacs/site-lisp/w3m/w3m-ucs /home/bronger/.emacs.d/lisp/w3m/mew-w3m hides /usr/local/share/emacs/site-lisp/w3m/mew-w3m /home/bronger/.emacs.d/lisp/w3m/w3m-ems hides /usr/local/share/emacs/site-lisp/w3m/w3m-ems /home/bronger/.emacs.d/lisp/w3m/w3m-fb hides /usr/local/share/emacs/site-lisp/w3m/w3m-fb Features: (shadow sort mail-extr emacsbug sendmail calc-arith calc-math calc-alg calc-units calc-ext calc-misc calc-menu calc calc-loaddefs calc-macs misearch multi-isearch add-log flyspell ispell go-oracle imenu cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs rng-xsd xsd-regexp rng-cmpct rng-nxml rng-valid rng-loc rng-uri rng-parse nxml-parse rng-match rng-dt rng-util rng-pttrn nxml-ns nxml-mode nxml-outln nxml-rap sgml-mode dom nxml-util nxml-enc xmltok conf-mode vc-cvs gmane gnus-art mm-uu mml2015 mm-view mml-smime smime dig gnus-sum gnus-group gnus-undo gnus-start gnus-cloud nnimap nnmail mail-source tls gnutls utf7 netrc nnoo gnus-spec gnus-int gnus-range message puny rfc822 mml mml-sec epa epg mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader gnus-win gnus nnheader reftex-dcr reftex reftex-loaddefs reftex-vars font-latex latexenc dired-aux vc-git diff-mode python tramp-sh tramp tramp-compat tramp-loaddefs trampver ucs-normalize shell parse-time json map darkroom cql-mode sql view rust-mode swift-mode go-errcheck go-mode url url-proxy url-privacy url-expand url-methods url-history url-cookie url-domsuf url-util mailcap find-file ffap thingatpt etags xref project yaml-mode dockerfile-mode derived rx sh-script smie executable dired-x adaptive-wrap vc-dispatcher vc-bzr org-element org-rmail org-mhe org-irc org-info org-gnus gnus-util rmail rmail-loaddefs rfc2047 rfc2045 ietf-drums mail-utils org-docview org-bibtex bibtex org-bbdb org-w3m org-agenda ob-python org org-macro org-footnote org-pcomplete pcomplete org-list org-faces org-entities noutline outline org-version ob-emacs-lisp ob ob-tangle ob-ref ob-lob ob-table ob-exp org-src ob-keys ob-comint ob-core ob-eval org-compat org-macs org-loaddefs format-spec find-func server w3m browse-url doc-view subr-x jka-compr dired dired-loaddefs image-mode w3m-hist w3m-fb bookmark-w3m w3m-ems wid-edit w3m-ccl ccl w3m-favicon w3m-image w3m-proc w3m-util rst compile comint ansi-color ring browse-kill-ring mmm-mode mmm-univ mmm-class mmm-region mmm-auto mmm-vars mmm-utils mmm-compat cl bbdb-autoloads bbdb timezone cal-china lunar solar cal-dst cal-bahai cal-islam cal-hebrew holidays hol-loaddefs appt diary-lib diary-loaddefs cal-menu calendar cal-loaddefs preview prv-emacs info reporter latex easy-mmode tex-style tex-buf tex dbus xml advice mm-util mail-prsvr autorevert filenotify preview-latex tex-site auto-loads edmacro kmacro savehist desktop frameset delsel cus-start cus-load finder-inf package epg-config url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs password-cache url-vars seq byte-opt gv bytecomp byte-compile cl-extra help-mode easymenu cconv cl-loaddefs pcase cl-lib time-date mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core term/tty-colors frame cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite charscript case-table epa-hook jka-cmpr-hook help simple abbrev obarray minibuffer cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote dbusbind inotify dynamic-setting system-font-setting font-render-setting x multi-tty make-network-process emacs) Memory information: ((conses 16 778854 42772) (symbols 48 57111 2) (miscs 40 8560 418) (strings 32 148240 21268) (string-bytes 1 4683887) (vectors 16 82340) (vector-slots 8 2013364 207133) (floats 8 1864 650) (intervals 56 25509 0) (buffers 976 336) (heap 1024 83381 2852)) -- Torsten Bronger ^ permalink raw reply [flat|nested] 15+ messages in thread
* bug#25652: 26.0.50; calc says that cos(1 degree) is 0.54 2017-02-08 7:37 bug#25652: 26.0.50; calc says that cos(1 degree) is 0.54 Torsten Bronger @ 2017-02-08 17:39 ` Eli Zaretskii 2017-02-08 18:52 ` Torsten Bronger 2017-02-08 19:31 ` Óscar Fuentes ` (2 subsequent siblings) 3 siblings, 1 reply; 15+ messages in thread From: Eli Zaretskii @ 2017-02-08 17:39 UTC (permalink / raw) To: Torsten Bronger; +Cc: 25652 > From: Torsten Bronger <bronger@physik.rwth-aachen.de> > Date: Wed, 8 Feb 2017 08:37:57 +0100 > > > In Emacs calc usind degree mode, cos(1) results in 0.540302305868 > instead of 0.999847695156. Are you sure you were in degree mode? ^ permalink raw reply [flat|nested] 15+ messages in thread
* bug#25652: 26.0.50; calc says that cos(1 degree) is 0.54 2017-02-08 17:39 ` Eli Zaretskii @ 2017-02-08 18:52 ` Torsten Bronger 0 siblings, 0 replies; 15+ messages in thread From: Torsten Bronger @ 2017-02-08 18:52 UTC (permalink / raw) To: 25652 Hallöchen! Eli Zaretskii writes: >> From: Torsten Bronger <bronger@physik.rwth-aachen.de> >> Date: Wed, 8 Feb 2017 08:37:57 +0100 >> >> >> In Emacs calc usind degree mode, cos(1) results in 0.540302305868 >> instead of 0.999847695156. > > Are you sure you were in degree mode? Absolutely. And funny enough, cos(90) resulted in zero(!). For the whole time, Deg was in the modeline, and I didn't switch anything. Also with "emacs -q". The sequence "m d 90 C 1 C m r 90 C 1 C" yields: 0 0.540302305868 -0.448073616129 0.540302305868 Tschö, Torsten. -- Torsten Bronger ^ permalink raw reply [flat|nested] 15+ messages in thread
* bug#25652: 26.0.50; calc says that cos(1 degree) is 0.54 2017-02-08 7:37 bug#25652: 26.0.50; calc says that cos(1 degree) is 0.54 Torsten Bronger 2017-02-08 17:39 ` Eli Zaretskii @ 2017-02-08 19:31 ` Óscar Fuentes 2017-02-08 19:36 ` Noam Postavsky 2017-02-09 9:08 ` Torsten Bronger 2017-02-13 3:40 ` Tino Calancha 3 siblings, 1 reply; 15+ messages in thread From: Óscar Fuentes @ 2017-02-08 19:31 UTC (permalink / raw) To: Torsten Bronger; +Cc: 25652 Torsten Bronger <bronger@physik.rwth-aachen.de> writes: > In Emacs calc usind degree mode, cos(1) results in 0.540302305868 > instead of 0.999847695156. > > > In GNU Emacs 26.0.50.3 (x86_64-pc-linux-gnu) > of 2017-02-08 built on wilson After pulling and building *right* *now* M-x version says GNU Emacs 26.0.50.1 (x86_64-pc-linux-gnu, X toolkit) of 2017-02-08 Why the OP version is 26.0.50.3 ? > Repository revision: c8ee570a8be7afaae3ea318b9d7dbffb62a7bbd0 This revision exists and is one behind `master' on my checkout. BTW, I can't reproduce the problem following the recipe described by the OP on his other message. ^ permalink raw reply [flat|nested] 15+ messages in thread
* bug#25652: 26.0.50; calc says that cos(1 degree) is 0.54 2017-02-08 19:31 ` Óscar Fuentes @ 2017-02-08 19:36 ` Noam Postavsky 0 siblings, 0 replies; 15+ messages in thread From: Noam Postavsky @ 2017-02-08 19:36 UTC (permalink / raw) To: Óscar Fuentes; +Cc: 25652, Torsten Bronger On Wed, Feb 8, 2017 at 2:31 PM, Óscar Fuentes <ofv@wanadoo.es> wrote: > Torsten Bronger <bronger@physik.rwth-aachen.de> writes: > >> In Emacs calc usind degree mode, cos(1) results in 0.540302305868 >> instead of 0.999847695156. >> >> >> In GNU Emacs 26.0.50.3 (x86_64-pc-linux-gnu) >> of 2017-02-08 built on wilson > > After pulling and building *right* *now* M-x version says > > GNU Emacs 26.0.50.1 (x86_64-pc-linux-gnu, X toolkit) of 2017-02-08 > > Why the OP version is 26.0.50.3 ? The last number is the build number, and just counts the number of times you rebuilt Emacs locally, see #25590. > >> Repository revision: c8ee570a8be7afaae3ea318b9d7dbffb62a7bbd0 > > This revision exists and is one behind `master' on my checkout. > > BTW, I can't reproduce the problem following the recipe described by the > OP on his other message. > I can't reproduce it either, cos(1) gives the expected 0.999847695156 in degree mode. 4: 0 3: 0.999847695156 2: -0.448073616129 1: 0.540302305868 ^ permalink raw reply [flat|nested] 15+ messages in thread
* bug#25652: 26.0.50; calc says that cos(1 degree) is 0.54 2017-02-08 7:37 bug#25652: 26.0.50; calc says that cos(1 degree) is 0.54 Torsten Bronger 2017-02-08 17:39 ` Eli Zaretskii 2017-02-08 19:31 ` Óscar Fuentes @ 2017-02-09 9:08 ` Torsten Bronger 2017-02-09 14:06 ` npostavs 2017-02-13 3:40 ` Tino Calancha 3 siblings, 1 reply; 15+ messages in thread From: Torsten Bronger @ 2017-02-09 9:08 UTC (permalink / raw) To: 25652 Hallöchen! Okay, I have one computer on which I can reproduce this bug reliably, with "emacs -q" and a fresh checkout. And another computer on which the bug does not occur. The most significant difference is Ubuntu 16.04 vs Ubuntu 16.10. If I just wanted to gt rid of the problem, I would remove my git repo and make a fresh clone. However, maybe you are interested in me doing further tests before? Or should I just try to get rid of the problem? FWIW, at https://bob.ipv.kfa-juelich.de/bronger/emacs_bug_25652.tar.gz you can download my copy Emacs' source code (700MB, 10 MB/sec link). It also contains the script I use to update my local Emacs installation. Tschö, Torsten. -- Torsten Bronger ^ permalink raw reply [flat|nested] 15+ messages in thread
* bug#25652: 26.0.50; calc says that cos(1 degree) is 0.54 2017-02-09 9:08 ` Torsten Bronger @ 2017-02-09 14:06 ` npostavs 2017-02-09 18:09 ` Glenn Morris 0 siblings, 1 reply; 15+ messages in thread From: npostavs @ 2017-02-09 14:06 UTC (permalink / raw) To: 25652; +Cc: Torsten Bronger Torsten Bronger <bronger@physik.rwth-aachen.de> writes: > Hallöchen! > > Okay, I have one computer on which I can reproduce this bug > reliably, with "emacs -q" and a fresh checkout. And another > computer on which the bug does not occur. The most significant > difference is Ubuntu 16.04 vs Ubuntu 16.10. Does it happen also with "emacs -Q"? I think the uppercase version disables a few more customizations. Anyway, I suggest instrumenting calc-cos and stepping with edebug until something weird happens. PS: you have "Mail-Followup-To: bug-gnu-emacs@gnu.org" in your headers which is wrong, because followups should go to 25652@debbugs.gnu.org, so I ignored that and the "Mail-Copies-To: never" header. ^ permalink raw reply [flat|nested] 15+ messages in thread
* bug#25652: 26.0.50; calc says that cos(1 degree) is 0.54 2017-02-09 14:06 ` npostavs @ 2017-02-09 18:09 ` Glenn Morris 2017-02-10 6:17 ` Torsten Bronger 0 siblings, 1 reply; 15+ messages in thread From: Glenn Morris @ 2017-02-09 18:09 UTC (permalink / raw) To: npostavs; +Cc: 25652, Torsten Bronger npostavs@users.sourceforge.net wrote: > PS: you have "Mail-Followup-To: bug-gnu-emacs@gnu.org" in your headers > which is wrong, because followups should go to 25652@debbugs.gnu.org, so > I ignored that and the "Mail-Copies-To: never" header. FWIW it's not wrong, in that bug-gnu-emacs@gnu.org and 25652@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. Anyway, what about this: Loading /home/bronger/.calc.el (source)...done I don't think this respects -Q? ^ permalink raw reply [flat|nested] 15+ messages in thread
* bug#25652: 26.0.50; calc says that cos(1 degree) is 0.54 2017-02-09 18:09 ` Glenn Morris @ 2017-02-10 6:17 ` Torsten Bronger 2017-02-10 7:59 ` Torsten Bronger 2017-02-11 10:16 ` Torsten Bronger 0 siblings, 2 replies; 15+ messages in thread From: Torsten Bronger @ 2017-02-10 6:17 UTC (permalink / raw) To: 25652 Hallöchen! Glenn Morris writes: > npostavs@users.sourceforge.net wrote: > >> PS: you have "Mail-Followup-To: bug-gnu-emacs@gnu.org" in your >> headers which is wrong, because followups should go to >> 25652@debbugs.gnu.org, so I ignored that and the "Mail-Copies-To: >> never" header. > > FWIW it's not wrong, in that bug-gnu-emacs@gnu.org and > 25652@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 ^ permalink raw reply [flat|nested] 15+ messages in thread
* bug#25652: 26.0.50; calc says that cos(1 degree) is 0.54 2017-02-10 6:17 ` Torsten Bronger @ 2017-02-10 7:59 ` Torsten Bronger 2017-02-11 10:16 ` Torsten Bronger 1 sibling, 0 replies; 15+ messages in thread From: Torsten Bronger @ 2017-02-10 7:59 UTC (permalink / raw) To: 25652 Hallöchen! Torsten Bronger writes: > [...] > > 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. Unfortunately, my second machine still does not exhibit this problem, as doesn't probably yours. So I have to dig deeper. This is really odd, since both machines are so similar. (They even mount the same $HOME.) Tschö, Torsten. -- Torsten Bronger ^ permalink raw reply [flat|nested] 15+ messages in thread
* bug#25652: 26.0.50; calc says that cos(1 degree) is 0.54 2017-02-10 6:17 ` Torsten Bronger 2017-02-10 7:59 ` Torsten Bronger @ 2017-02-11 10:16 ` Torsten Bronger 2017-02-11 14:14 ` npostavs 1 sibling, 1 reply; 15+ messages in thread From: Torsten Bronger @ 2017-02-11 10:16 UTC (permalink / raw) To: 25652 Hallöchen! Torsten Bronger writes: > [...] > > 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. [...] After havin updated to current git master, I can now reproduce this on both of my machine. Can you confirm? > [...] > > 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. As I can reproduce this. Tschö, Torsten. -- Torsten Bronger ^ permalink raw reply [flat|nested] 15+ messages in thread
* bug#25652: 26.0.50; calc says that cos(1 degree) is 0.54 2017-02-11 10:16 ` Torsten Bronger @ 2017-02-11 14:14 ` npostavs 0 siblings, 0 replies; 15+ messages in thread From: npostavs @ 2017-02-11 14:14 UTC (permalink / raw) To: 25652; +Cc: Tino Calancha tags 25652 confirmed retitle 25652 26.0.50; [calc] In Units Simplication + Degree mode cos(1 deg) != cos(1) quit Torsten Bronger <bronger@physik.rwth-aachen.de> writes: >> 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. [...] > > After havin updated to current git master, I can now reproduce this > on both of my machine. Can you confirm? Yes, this happens in units simplication mode. Note that 'cos(1 deg) RET does give 0.999. It seems to be because of the fix for #23889 [1: 713e922243]. Tino, any ideas? 1: 2016-07-12 00:38:14 +0900 713e922243fb60d850f7b0ff83f3e2a3682f1832 Ignore angle mode while simplifying units ^ permalink raw reply [flat|nested] 15+ messages in thread
* bug#25652: 26.0.50; calc says that cos(1 degree) is 0.54 2017-02-08 7:37 bug#25652: 26.0.50; calc says that cos(1 degree) is 0.54 Torsten Bronger ` (2 preceding siblings ...) 2017-02-09 9:08 ` Torsten Bronger @ 2017-02-13 3:40 ` Tino Calancha 2017-05-18 3:32 ` npostavs 3 siblings, 1 reply; 15+ messages in thread From: Tino Calancha @ 2017-02-13 3:40 UTC (permalink / raw) To: 25652 [Forwading to the bug thread: Sorry if you receive this message twice] npostavs@users.sourceforge.net writes: > tags 25652 confirmed > retitle 25652 26.0.50; [calc] In Units Simplication + Degree mode cos(1 deg) != cos(1) > quit > > Torsten Bronger <bronger@physik.rwth-aachen.de> writes: >>> 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. [...] >> >> After havin updated to current git master, I can now reproduce this >> on both of my machine. Can you confirm? > > Yes, this happens in units simplication mode. Note that 'cos(1 deg) RET > does give 0.999. It seems to be because of the fix for #23889 [1: > 713e922243]. Tino, any ideas? > > 1: 2016-07-12 00:38:14 +0900 713e922243fb60d850f7b0ff83f3e2a3682f1832 > Ignore angle mode while simplifying units 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... ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; From 1a2592409c0fcfca7826b71248d3d3d234355c13 Mon Sep 17 00:00:00 2001 From: Tino Calancha <tino.calancha@gmail.com> Date: Sun, 12 Feb 2017 21:14:34 +0900 Subject: [PATCH 1/2] Revert 'Ignore angle mode while simplifying units' This commit (713e922243) cause regressions (Bug#25652). --- lisp/calc/calc-forms.el | 12 +++--------- lisp/calc/calc-math.el | 12 ++++-------- 2 files changed, 7 insertions(+), 17 deletions(-) diff --git a/lisp/calc/calc-forms.el b/lisp/calc/calc-forms.el index 6aa421ec20..abf76cf07e 100644 --- a/lisp/calc/calc-forms.el +++ b/lisp/calc/calc-forms.el @@ -317,9 +317,7 @@ math-to-hms (list 'calcFunc-hms a)) ((math-negp a) (math-neg (math-to-hms (math-neg a) ang))) - ((eq (or ang - (and (not math-simplifying-units) calc-angle-mode)) - 'rad) + ((eq (or ang calc-angle-mode) 'rad) (math-to-hms (math-div a (math-pi-over-180)) 'deg)) ((memq (car-safe a) '(cplx polar)) a) (t @@ -356,16 +354,12 @@ math-from-hms (if (eq (car-safe a) 'sdev) (math-make-sdev (math-from-hms (nth 1 a) ang) (math-from-hms (nth 2 a) ang)) - (if (eq (or ang - (and (not math-simplifying-units) calc-angle-mode)) - 'rad) + (if (eq (or ang calc-angle-mode) 'rad) (list 'calcFunc-rad a) (list 'calcFunc-deg a))))) ((math-negp a) (math-neg (math-from-hms (math-neg a) ang))) - ((eq (or ang - (and (not math-simplifying-units) calc-angle-mode)) - 'rad) + ((eq (or ang calc-angle-mode) 'rad) (math-mul (math-from-hms a 'deg) (math-pi-over-180))) (t (math-add (math-div (math-add (math-div (nth 3 a) diff --git a/lisp/calc/calc-math.el b/lisp/calc/calc-math.el index 2590761d53..faa318d45d 100644 --- a/lisp/calc/calc-math.el +++ b/lisp/calc/calc-math.el @@ -763,14 +763,12 @@ calcFunc-nroot (defun math-to-radians (a) ; [N N] (cond ((eq (car-safe a) 'hms) (math-from-hms a 'rad)) - ((and (not math-simplifying-units) - (memq calc-angle-mode '(deg hms))) + ((memq calc-angle-mode '(deg hms)) (math-mul a (math-pi-over-180))) (t a))) (defun math-from-radians (a) ; [N N] - (cond ((and (not math-simplifying-units) - (eq calc-angle-mode 'deg)) + (cond ((eq calc-angle-mode 'deg) (if (math-constp a) (math-div a (math-pi-over-180)) (list 'calcFunc-deg a))) @@ -781,16 +779,14 @@ math-from-radians (defun math-to-radians-2 (a &optional force-symbolic) ; [N N] (cond ((eq (car-safe a) 'hms) (math-from-hms a 'rad)) - ((and (not math-simplifying-units) - (memq calc-angle-mode '(deg hms))) + ((memq calc-angle-mode '(deg hms)) (if (or calc-symbolic-mode force-symbolic) (math-div (math-mul a '(var pi var-pi)) 180) (math-mul a (math-pi-over-180)))) (t a))) (defun math-from-radians-2 (a &optional force-symbolic) ; [N N] - (cond ((and (not math-simplifying-units) - (memq calc-angle-mode '(deg hms))) + (cond ((memq calc-angle-mode '(deg hms)) (if (or calc-symbolic-mode force-symbolic) (math-div (math-mul 180 a) '(var pi var-pi)) (math-div a (math-pi-over-180)))) -- 2.11.0 From b1b6f62f5baa8023a7b5d45b1d30399c8e8f82a2 Mon Sep 17 00:00:00 2001 From: Tino Calancha <tino.calancha@gmail.com> Date: Sun, 12 Feb 2017 21:45:47 +0900 Subject: [PATCH 2/2] Prevent from override input angle unit while simplifying Ignore calc-angle-mode while simplifying if the expression contains angle units (Bug#23899). * lisp/calc/calc-alg.el (calc-input-angle-units): New defun. (math-simplify): If TOP-EXPR contains angle units, then bind calc-angle-mode to 'rad. * test/lisp/calc/calc-tests.el (test-calc-23889): New test. --- lisp/calc/calc-alg.el | 9 +++++++++ test/lisp/calc/calc-tests.el | 46 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+) diff --git a/lisp/calc/calc-alg.el b/lisp/calc/calc-alg.el index 4e63d238c7..9db901a975 100644 --- a/lisp/calc/calc-alg.el +++ b/lisp/calc/calc-alg.el @@ -355,10 +355,19 @@ math-hyperbolic-trig-rewrite ;; math-simplify-step, which is called by math-simplify. (defvar math-top-only) +(defun calc-input-angle-units (input) + (cond ((math-expr-contains input '(var deg var-deg)) 'deg) + ((math-expr-contains input '(var rad var-rad)) 'rad) + ((math-expr-contains input '(var hms var-hms)) 'hms) + (t nil))) + ;; math-normalize-error is declared in calc.el. (defvar math-normalize-error) (defun math-simplify (top-expr) (let ((math-simplifying t) + (calc-angle-mode (if (calc-input-angle-units top-expr) + 'rad + calc-angle-mode)) (math-top-only (consp calc-simplify-mode)) (simp-rules (append (and (calc-has-rules 'var-AlgSimpRules) '((var AlgSimpRules var-AlgSimpRules))) diff --git a/test/lisp/calc/calc-tests.el b/test/lisp/calc/calc-tests.el index 8f56d48d01..45b735c3c6 100644 --- a/test/lisp/calc/calc-tests.el +++ b/test/lisp/calc/calc-tests.el @@ -86,6 +86,52 @@ calc-tests-simple (math-read-expr "1m") "cm") '(* -100 (var cm var-cm))))) +(ert-deftest test-calc-23889 () + "Test for http://debbugs.gnu.org/23889 and 25652." + (dolist (mode '(deg rad)) + (let ((calc-angle-mode mode)) + ;; If user inputs angle units, then should ignore `calc-angle-mode'. + (should (string= "5253" + (substring + (number-to-string + (nth 1 + (math-simplify-units + '(calcFunc-cos (* 45 (var rad var-rad)))))) + 0 4))) + (should (string= "7071" + (substring + (number-to-string + (nth 1 + (math-simplify-units + '(calcFunc-cos (* 45 (var deg var-deg)))))) + 0 4))) + (should (string= "8939" + (substring + (number-to-string + (nth 1 + (math-simplify-units + '(+ (calcFunc-sin (* 90 (var rad var-rad))) + (calcFunc-cos (* 90 (var deg var-deg))))))) + 0 4))) + (should (string= "5519" + (substring + (number-to-string + (nth 1 + (math-simplify-units + '(+ (calcFunc-sin (* 90 (var deg var-deg))) + (calcFunc-cos (* 90 (var rad var-rad))))))) + 0 4))) + ;; If user doesn't input units, then must use `calc-angle-mode'. + (should (string= (if (eq calc-angle-mode 'deg) + "9998" + "5403") + (substring + (number-to-string + (nth 1 + (math-simplify-units + '(calcFunc-cos 1)))) + 0 4)))))) + (provide 'calc-tests) ;;; calc-tests.el ends here -- 2.11.0 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; In GNU Emacs 26.0.50.1 (x86_64-pc-linux-gnu, GTK+ Version 3.22.7) of 2017-02-12 Repository revision: 862d6438cfa6c6c035033697751f3d002357b024 ^ permalink raw reply related [flat|nested] 15+ messages in thread
* bug#25652: 26.0.50; calc says that cos(1 degree) is 0.54 2017-02-13 3:40 ` Tino Calancha @ 2017-05-18 3:32 ` npostavs 2017-05-18 5:51 ` Tino Calancha 0 siblings, 1 reply; 15+ messages in thread From: npostavs @ 2017-05-18 3:32 UTC (permalink / raw) To: Tino Calancha; +Cc: 25652 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. ^ permalink raw reply [flat|nested] 15+ messages in thread
* bug#25652: 26.0.50; calc says that cos(1 degree) is 0.54 2017-05-18 3:32 ` npostavs @ 2017-05-18 5:51 ` Tino Calancha 0 siblings, 0 replies; 15+ messages in thread From: Tino Calancha @ 2017-05-18 5:51 UTC (permalink / raw) To: 25652-done 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 ^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2017-05-18 5:51 UTC | newest] Thread overview: 15+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2017-02-08 7:37 bug#25652: 26.0.50; calc says that cos(1 degree) is 0.54 Torsten Bronger 2017-02-08 17:39 ` Eli Zaretskii 2017-02-08 18:52 ` Torsten Bronger 2017-02-08 19:31 ` Óscar Fuentes 2017-02-08 19:36 ` Noam Postavsky 2017-02-09 9:08 ` Torsten Bronger 2017-02-09 14:06 ` npostavs 2017-02-09 18:09 ` Glenn Morris 2017-02-10 6:17 ` Torsten Bronger 2017-02-10 7:59 ` Torsten Bronger 2017-02-11 10:16 ` Torsten Bronger 2017-02-11 14:14 ` npostavs 2017-02-13 3:40 ` Tino Calancha 2017-05-18 3:32 ` npostavs 2017-05-18 5:51 ` Tino Calancha
Code repositories for project(s) associated with this external index https://git.savannah.gnu.org/cgit/emacs.git https://git.savannah.gnu.org/cgit/emacs/org-mode.git This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.