Using Prime calc. as benchmark

Quote:

> > > ...

> > > On Fortrans that don't provide support for 8-bit integers, it will

> > use

> > > a word (32 bits or whatever).

> > Oh contraire! If the compiler doesnt recognize INTEGER(1) syntax it

> > will

> > error the statement (or shud)..

> Then you change the program to use something portable.

> There's no guarantee that "integer (1)" will get you

> anything, because that form is non-portable anyway.

> Yu could get 32-bit integers with integer(1), or evem 64-bit integers!

As I recall the standard, the "kind type" (the number in parentheses

in "INTEGER(1)") need not represent anything in particular. The

requirement is that different kind types represent different precisions

and that larger kind type values indicate more precision than smaller

kind type values. There is no requirement that kind type numbers

start at one, that they be sequential, or that they correspond to

powers of two. So Robin is correct that "INTEGER(1)" is not

necessarily portable (though in practice it probably is).

On the other hand, there are intrinsic functions for determining the

kind type of an 8-bit integer (assuming the compiler in use supports

them) so it is possible to write a portable declaration -- as long as

the compiler supports an 8-bit integer type (not guaranteed).

Actually, the intrinsic function will return the smallest kind type

capable of holding an 8-bit integer -- depending on implementation,

that could be a 32- or even 64-bit integer; there would be no error

message.

Bob Lidral