[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Making 'eq' == 'eql' in bignum branch

From: Paul Eggert
Subject: Re: Making 'eq' == 'eql' in bignum branch
Date: Fri, 31 Aug 2018 09:41:54 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1

Stefan Monnier wrote:

Same here, except rather than "I'm fine with" I'd say that I'm in favor
of it (for the same reason that I made `apply` work when called with
a single argument).

I looked into implementing something along those lines and ran into a problem: the C standard does not require support for floating-point infinity, and a few mildly-plausible Emacs targets lack it. The most significant is IBM z/OS when compiled in default mode. There is also the Unisys Clearpath (formerly Burroughs) and Dorado (formerly Univac) lines. These environments are still supported, and help explain why the C standard does not require support for a working INFINITY macro in <math.h>, and why Common Lisp does not require infinity constants.

That being said, I now see that the Emacs source code has been using <math.h>'s INFINITY macro since Emacs 25.1. Although this was just an oversight (and I just now fixed it on master), nobody has complained.

With that in mind we could simply be upfront about it and explicitly require IEEE floating point, excluding old mainframe environments and some embedded platforms. Then we could change 'min' and 'max' to return infinity, and we can also simplify the C code a bit by assuming IEEE_FLOATING_POINT. On the other hand perhaps it's better to leave sleeping dogs lie, and not jump completely into the IEEE bed, and wait for the next C standard to revamp the floating point API again (which it looks like it will) before worrying about this.

As for a named constant, I now see a problem with it: it wouldn't work in expressions like (let ((gamow '(1 2 3 infinity))) ...). So perhaps we should just ask people to remember to use 1e+INF instead, as it doesn't have this syntactic glitch.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]