Sujet : Re: Is there a way in Fortran to designate an integer value as integer*8 ?
De : sgk (at) *nospam* REMOVEtroutmask.apl.washington.edu (Steven G. Kargl)
Groupes : comp.lang.fortranDate : 03. Oct 2024, 23:40:07
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vdn6g7$3tfnc$1@dont-email.me>
References : 1 2 3 4 5 6 7 8 9
User-Agent : Pan/0.145 (Duplicitous mercenary valetism; d7e168a git.gnome.org/pan2)
On Thu, 03 Oct 2024 22:28:31 +0100, Clive Page wrote:
On 03/10/2024 20:59, Steven G. Kargl wrote:
My personal recommendation would be to do a proper porting from
integer (aka integer*4) to integer(kind=8). And, yes, 8 in the
'kind=8' is not portable.
Yes because different compilers use different integer kind numbers for
different purposes: at least one uses kinds 1, 2, 3, 4 for the four most
common numbers of bytes where other compilers use 1, 2, 4, 8. But if you
use integer(kind=int64) this is portable.
(Although unlikely) what happens when int64 = -1?
I suppose 'integer(-1)' is portable to the extent
that a compiler will error out.
-- steve