[Cfp-interest 3251] Re: Lingering references to imaginary type
Damian McGuckin
damianm at esi.com.au
Tue Aug 27 19:12:56 PDT 2024
Thanks Jim, I thought I had gone through Annex G to catch the last of
those.
On Tue, 27 Aug 2024, Jim Thomas wrote:
> Below is a link to a draft proposal per action item:
> Jim: Draft proposal to remove instances of imaginary
> lingering in draft.
>
> https://wiki.edg.com/pub/CFP/WebHome/C2Y proposal - lingering references to
> imaginary type-20240827.pdf
I do not want to pick at straws but in G.3.2#5,
return x + I * y
is perfectly legal as 7.3.1 says that I is equivalent to _Complex_I.
(unless a programmer is crazy enough to redefine the macro I - uggh!)
I actually think that we could even say in 7.3.9.3#3
CMPLX(x, y) returns x + I * y
Because this is exactly what it does! Very succinct.
Note that we could be creating a rod for our own back (or that of somebody
else if we are not around in 2029 or 2038 when IEEE 754 might or might not
have complex arithmetic). I can already see a problem with the definition
of the term "complex type" (which was hinted at by the mistake somebody
else made in talking about "complex floating type" in paragraph 7.27#10 of
the current document)
Note that my corrections address that mistake in 7.27#10 because there is
no such that as a "complex floating type".
But they do not address the fundamental issue if we see imaginary types
come back at a later date (if IEEE 754 precipitates that). Note that when
the C standard talks about "real types" now, it does so in the almost
strict mathematical sense. When it currently talks about "complex types"
it is normally talking about C types. But that is a whole new problem. To
follow what the standard does for "real types", i.e. the standard floating
types, decimal floating types, and integers, yes, integers, we would have
to define "complex types" as a combination of only a single category
complex floating types
and change a gazillion places in the standard. Not a tiny task.
Then, complex types can retain its mathematical meaning. And at a later
stage, if the C type "imaginary" makes a comeback, then we can add
imaginary floating types
to the concept of "complex types".
But changing the C standard to handle this very distant scenario is NOT
worth it. It is happens post 2038, most of us won't have to worry about it
as we will be long out of the picture and lying on a beach in retirmenet
or otherwise.
- Damian
More information about the Cfp-interest
mailing list