From: Eli Zaretskii <eliz@gnu.org>
To: Paul Eggert <eggert@cs.ucla.edu>
Cc: 30408@debbugs.gnu.org, emacs-devel@gnu.org
Subject: bug#30408: Checking for loss of information on integer conversion
Date: Sun, 18 Feb 2018 22:24:34 +0200 [thread overview]
Message-ID: <83fu5y9hbx.fsf__39104.6929326423$1518985416$gmane$org@gnu.org> (raw)
In-Reply-To: <74ac7b77-a756-95a9-b490-6952cf106f21@cs.ucla.edu> (message from Paul Eggert on Sun, 18 Feb 2018 12:04:20 -0800)
> From: Paul Eggert <eggert@cs.ucla.edu>
> Cc: emacs-devel@gnu.org, 30408@debbugs.gnu.org
> Date: Sun, 18 Feb 2018 12:04:20 -0800
>
> > Emacs Lisp is not used to write software that controls
> > aircraft and spaceships
>
> Actually, I maintain Emacs Lisp code that controls timestamps used in aircraft
> and spaceships. I'm not saying that Emacs itself runs the aircraft and
> spaceships, but it definitely is used to develop software and data used there.
> As luck would have it, I'm currently engaged in an email thread about time
> transfer between Earth and Mars (yes, this is really a thing and people are
> trying to do it with millisecond precision) that is related to a project where I
> regularly use Emacs Lisp. See the thread containing this message:
Interesting, but not really relevant to the issue at hand, IMO. I was
talking about real-time control, not off-line calculations. And I did
propose to have this feature as opt-in, so the kind of calculations
that transfer me to Mars could still be held safely and accurately.
> > More generally, why signaling an error by default in this case is a
> > good idea? ... That would
> > be similar to behavior of equivalent constructs in C programs
>
> Sure, and C compilers typically issue diagnostics for situations similar to
> what's in Bug#30408. For example, for this C program:
>
> int a = 18446744073709553664;
>
> GCC issues a diagnostic, whereas for the similar Emacs Lisp program:
>
> (setq b 18446744073709553664)
>
> Emacs silently substitutes a number that is off by 2048.
I'm okay with flagging such constants during byte compilation. I was
talking only about run-time diagnostics, not compile-time diagnostics.
> When people write a floating-point number they naturally expect it to have some
> fuzz. But when they write an integer they expect it to be represented exactly,
> and not to be rounded.
That is true, but Emacs behaved like it does today for many years, and
I'm worried by the possible breakage such a significant behavior
change could have, including on our own code.
next prev parent reply other threads:[~2018-02-18 20:24 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-18 1:27 Checking for loss of information on integer conversion Paul Eggert
[not found] ` <83y3jq9q4m.fsf@gnu.org>
2018-02-18 20:04 ` bug#30408: " Paul Eggert
2018-02-18 20:04 ` Paul Eggert
2018-02-18 20:24 ` Eli Zaretskii
2018-03-09 5:00 ` bug#30408: " Paul Eggert
2018-03-09 8:22 ` Eli Zaretskii
2018-03-21 19:13 ` Paul Eggert
2018-03-21 19:29 ` Eli Zaretskii
2018-02-18 20:24 ` Eli Zaretskii [this message]
2018-02-18 21:52 ` Drew Adams
2018-03-27 23:19 ` Paul Eggert
2018-03-29 11:11 ` Eli Zaretskii
2018-03-29 18:09 ` Paul Eggert
2018-02-18 22:31 ` Juliusz Chroboczek
2018-02-18 22:41 ` Stefan Monnier
2018-02-18 23:46 ` Juliusz Chroboczek
2018-02-19 1:47 ` Stefan Monnier
2018-02-19 2:22 ` Paul Eggert
2018-02-19 3:20 ` Drew Adams
2018-02-19 15:05 ` Richard Stallman
2018-02-22 16:31 ` Juliusz Chroboczek
2018-02-22 17:01 ` Eli Zaretskii
2018-02-22 19:31 ` Stefan Monnier
2018-02-23 9:49 ` Richard Stallman
2018-02-19 6:03 ` John Wiegley
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='83fu5y9hbx.fsf__39104.6929326423$1518985416$gmane$org@gnu.org' \
--to=eliz@gnu.org \
--cc=30408@debbugs.gnu.org \
--cc=eggert@cs.ucla.edu \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.