all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Paul Eggert <eggert@cs.ucla.edu>
To: Helmut Eller <eller.helmut@gmail.com>, emacs-devel@gnu.org
Subject: Re: integer overflow handling for most-negative-fixnum
Date: Mon, 23 Jul 2018 12:40:36 -0700	[thread overview]
Message-ID: <d97cbccb-bd1f-79e0-973b-b7a2b94630f6@cs.ucla.edu> (raw)
In-Reply-To: <m27elol58g.fsf@gmail.com>

Helmut Eller wrote:

> Can't you simply use some other character for this, like %z (or %ℤ) and
> leave %x alone.

It'd require three new letters, since %o is also affected. I'd rather not chew 
up so many letters for such an obscure feature. And as it doesn't appear that 
this change will break much if anything, I'd rather not chew up any letters at 
all; let's just fix %x etc. so that they're not machine-dependent.

>> However, it would
>> be an incompatible change, so let's have the behavior depend on a
>> compatibility variable, much as we already do for
>> read-integer-overflow-as-float.
> 
> This sounds more like that other desaster: text-quoting-style.

:-) Yes, I remember that well. However, this is a much smaller deal. With 
text-quoting style I had to change many uses and the magnitude of the task was 
known (most of it was in the patches I proposed). Here, I've audited the Emacs 
source code and have not found any need to change anything, except optionally 
for appearance to make a few strings look nicer, and in a couple of tests that 
stress Emacs with unlikely inputs, tests that I've updated in the patch I 
proposed. See Bug#32252.

> %a also seems like a candidate: in C99 %a prints floating point numbers
> in hexadecimal notation.
If we were to implement %a it should be reasonably consistent with C99 %a, and 
this is something quite different from %x and %X and %o. So we should use a 
different letter, if we're going to use any new letter which I'd rather not.

> That might be useful so that Emacs can write/read floats without rounding errors.

We already have that: (format "%s" N) outputs any number N in a format that can 
be read back without rounding errors. Similar functionality is available via 
(number-to-string N), (prin1-to-string N), etc. With all these, the only loss of 
floating-point info is with NaNs, something I'd like to fix even though they're 
not numbers.



  parent reply	other threads:[~2018-07-23 19:40 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-19  2:39 integer overflow handling for most-negative-fixnum Andy Moreton
2018-07-20 22:10 ` Paul Eggert
2018-07-21  5:22   ` Helmut Eller
2018-07-21  9:47   ` Andy Moreton
2018-07-21 10:14     ` Eli Zaretskii
2018-07-21 13:06       ` Andy Moreton
2018-07-21 17:15       ` Stefan Monnier
2018-07-21 17:48         ` Paul Eggert
2018-07-21 18:12           ` Stefan Monnier
2018-07-23 19:18             ` Paul Eggert
2018-07-23 19:57               ` Stefan Monnier
2018-07-23 23:09                 ` Paul Eggert
2018-07-21 20:10           ` Helmut Eller
2018-07-21 21:02             ` Helmut Eller
2018-07-23 19:40             ` Paul Eggert [this message]
2018-07-21 18:10         ` Eli Zaretskii
2018-07-21 18:17           ` Paul Eggert
2018-07-21 18:23             ` Eli Zaretskii
2018-07-21 18:42           ` Stefan Monnier
2018-07-21 18:51             ` Eli Zaretskii
2018-07-21 20:42               ` Stefan Monnier
2018-07-21 12:42     ` Helmut Eller
2018-07-21 17:46     ` Paul Eggert
2018-07-23 11:49       ` Andy Moreton
2018-07-23 17:30         ` Paul Eggert
2018-07-23 21:11           ` Andy Moreton
2018-07-24 12:14             ` Andreas Schwab
2018-07-24 13:06               ` Andy Moreton
2018-07-21  9:49   ` Paul Eggert

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=d97cbccb-bd1f-79e0-973b-b7a2b94630f6@cs.ucla.edu \
    --to=eggert@cs.ucla.edu \
    --cc=eller.helmut@gmail.com \
    --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.