Message from discussion example of KIND to replace DOUBLE PRECISION
From: David Thompson <dave.thomps...@verizon.net>
Subject: Re: example of KIND to replace DOUBLE PRECISION
References: <firstname.lastname@example.org> <QkZMl.email@example.com> <1ize6mm.18rjon1fbtd8Nfirstname.lastname@example.org> <email@example.com> <1izf3xf.qwr2a914bzbreNfirstname.lastname@example.org>
X-Newsreader: Forte Agent 3.3/32.846
Content-Type: text/plain; charset=us-ascii
Date: Mon, 25 May 2009 05:58:15 GMT
X-Trace: nwrddc02.gnilink.net 1243231095 18.104.22.168 (Mon, 25 May 2009 01:58:15 EDT)
NNTP-Posting-Date: Mon, 25 May 2009 01:58:15 EDT
On Fri, 8 May 2009 22:33:50 -0700, nos...@see.signature (Richard
<snip: kind numbers>
> No, they wouldn't be reals. That would be just as bad (and probably
> worse). The problem with them being integers (or any numeric type) is
> that it provides no error protection. You can do completely
> inappropriate things with them and the compiler likely won't catch ...
<snip: (distinct) derived types instead>
> In fact, apparently one of the compilers tested tried to do
> something like that and throw an error for the inappropriate usage.
> Unfortunately, with Fortran defined as it is today, that bit of compiler
> help counts as a compiler bug.
Even with integers, I think an implementor could use disjoint ranges.
(Actually, disjoint values is enough, but ranges is easier to explain
and keep straight.) E.g. use 100,101,... for integer kinds,
200,201,... for real (&cplx), 300,301,... for chars, etc.
> Another advantage is that you wouldn't have to continually caution
> people about how the standard doesn't specify particular numeric values
> for kind parameters. The question just wouldn't come up at all.
> [and...] It generally doesn't make any sense to be doing addition, multiplication,
> exponentiation, and Lord knows what else with kind parameter values.
Doesn't help with those, however.