GNU bug report logs -
#36822
26.2; Calc: calc-julian produces incorrect result
Previous Next
Reported by: "Michel Schinz" <michel <at> schi.nz>
Date: Sat, 27 Jul 2019 16:11:02 UTC
Severity: normal
Tags: confirmed, patch
Found in version 26.2
Done: Mattias Engdegård <mattiase <at> acm.org>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 36822 in the body.
You can then email your comments to 36822 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#36822
; Package
emacs
.
(Sat, 27 Jul 2019 16:11:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
"Michel Schinz" <michel <at> schi.nz>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Sat, 27 Jul 2019 16:11:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
To reproduce:
- start calc (M-x calc)
- enter algebraic mode (')
- enter today's date as <2019-07-27> then hit RET
- convert to Julian day count (t J)
- notice that the result is 2458690, which is wrong (the correct value
is 2458692)
Oddly enough, Emacs' calendar produces the correct value. To see this,
start the calendar (M-x calendar), navigate to the date above, then
press "p a". This displays the correct value:
Astronomical (Julian) day number (at noon UTC): 2458692.0
To cross-check, several web sites are available to compute the Julian
day number, e.g. http://numerical.recipes/julian.html
In GNU Emacs 26.2 (build 1, x86_64-apple-darwin18.2.0, NS appkit-1671.20 Version 10.14.3 (Build 18D109))
of 2019-04-13 built on builder10-14.porkrind.org
Windowing system distributor 'Apple', version 10.3.1671
Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
user-error: The mark is not set now, so there is no region
Welcome to the GNU Emacs Calculator! Press ‘?’ or ‘h’ for help, ‘q’ to quit
<help> DEL is undefined
Configured using:
'configure --with-ns '--enable-locallisppath=/Library/Application
Support/Emacs/${version}/site-lisp:/Library/Application
Support/Emacs/site-lisp' --with-modules'
Configured features:
NOTIFY ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS NS MODULES THREADS
Important settings:
value of $LANG: fr_CH.UTF-8
locale-coding-system: utf-8-unix
Major mode: Lisp Interaction
Minor modes in effect:
tooltip-mode: t
global-eldoc-mode: t
eldoc-mode: t
electric-indent-mode: t
mouse-wheel-mode: t
tool-bar-mode: t
menu-bar-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
font-lock-mode: t
blink-cursor-mode: t
auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t
line-number-mode: t
transient-mark-mode: t
Load-path shadows:
None found.
Features:
(shadow sort mail-extr emacsbug message rmc puny seq byte-opt gv
bytecomp byte-compile cconv cl-loaddefs cl-lib dired dired-loaddefs
format-spec rfc822 mml mml-sec password-cache epa derived epg epg-config
gnus-util rmail rmail-loaddefs mm-decode mm-bodies mm-encode mail-parse
rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045
ietf-drums mm-util mail-prsvr mail-utils calccomp calc-arith calc-alg
calc-misc calc-vec calc-forms calc-ext calc-aent calc-menu easymenu calc
calc-loaddefs calc-macs elec-pair time-date tooltip eldoc electric
uniquify ediff-hook vc-hooks lisp-float-type mwheel term/ns-win ns-win
ucs-normalize mule-util term/common-win 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 charprop 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 threads kqueue cocoa ns multi-tty make-network-process emacs)
Memory information:
((conses 16 238377 12447)
(symbols 48 23518 1)
(miscs 40 46 241)
(strings 32 36281 1818)
(string-bytes 1 950248)
(vectors 16 37616)
(vector-slots 8 761908 14102)
(floats 8 51 104)
(intervals 56 230 0)
(buffers 992 13))
[Message part 2 (text/html, inline)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#36822
; Package
emacs
.
(Tue, 30 Jul 2019 11:09:01 GMT)
Full text and
rfc822 format available.
Message #8 received at 36822 <at> debbugs.gnu.org (full text, mbox):
tags 36822 confirmed
quit
Thank you; Reproduced, and it does look wrong.
It looks like there are multiple flaws involved.
Added tag(s) confirmed.
Request was from
Mattias Engdegård <mattiase <at> acm.org>
to
control <at> debbugs.gnu.org
.
(Tue, 30 Jul 2019 11:09:02 GMT)
Full text and
rfc822 format available.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#36822
; Package
emacs
.
(Tue, 30 Jul 2019 15:52:01 GMT)
Full text and
rfc822 format available.
Message #13 received at 36822 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
tags 36822 patch
quit
> It looks like there are multiple flaws involved.
This was indeed the case. Attached is a patch that attempts to fix those that I found (I didn't dig very deeply).
As I'm no calendar expert, I would greatly value an independent review of the patch.
[0001-Fix-various-Calc-date-conversions-bug-36822.patch (application/octet-stream, attachment)]
Added tag(s) patch.
Request was from
Mattias Engdegård <mattiase <at> acm.org>
to
control <at> debbugs.gnu.org
.
(Tue, 30 Jul 2019 15:52:02 GMT)
Full text and
rfc822 format available.
Reply sent
to
Mattias Engdegård <mattiase <at> acm.org>
:
You have taken responsibility.
(Tue, 06 Aug 2019 12:05:02 GMT)
Full text and
rfc822 format available.
Notification sent
to
"Michel Schinz" <michel <at> schi.nz>
:
bug acknowledged by developer.
(Tue, 06 Aug 2019 12:05:02 GMT)
Full text and
rfc822 format available.
Message #20 received at 36822-done <at> debbugs.gnu.org (full text, mbox):
Patch pushed to master; it should at least make the code no worse than before.
Thanks for reporting the bug!
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Wed, 04 Sep 2019 11:24:04 GMT)
Full text and
rfc822 format available.
This bug report was last modified 5 years and 286 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.