- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have never figured out why is the logical type allows anything other than 1 byte (or really even 1 bit).
So even logical(1) has 7 bits too many, let alone logical(4).
Tim
So even logical(1) has 7 bits too many, let alone logical(4).
Tim
Link Copied
5 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In the beginning (or close to it), all Fortran types were either one "arithmetic storage unit" or two. INTEGER, REAL and LOGICAL were one storage unit, COMPLEX and DOUBLE PRECISION were two. Fortran had no concept of bytes, and in fact, prior to Fortran 77, didn't even have CHARACTER. Therefore, LOGICAL was the same size as INTEGER (and in fact there is a lot of wording in the standard stating this.)
Not until Fortran 90 did the concept of "kind" come around, so that you could have LOGICALs of different sizes. But even then, Fortran had no bit datatype (as it still doesn't today.) Even so, the default LOGICAL type is the same size as default INTEGER and REAL.
For further reading, see my article It's Only Logical.
Steve
Not until Fortran 90 did the concept of "kind" come around, so that you could have LOGICALs of different sizes. But even then, Fortran had no bit datatype (as it still doesn't today.) Even so, the default LOGICAL type is the same size as default INTEGER and REAL.
For further reading, see my article It's Only Logical.
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks,
I will look at your article.
However, if this is a fortran quirk, why so many other lang's also have things like boolean(2).
Similarly, the fact that there is logical(4) in the com server wizid means that this oversized type is not a fortran only quirk.
just curious.
Tim
I will look at your article.
However, if this is a fortran quirk, why so many other lang's also have things like boolean(2).
Similarly, the fact that there is logical(4) in the com server wizid means that this oversized type is not a fortran only quirk.
just curious.
Tim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Fortran now has the ability to specify different kinds (typically sizes) for LOGICAL. Note that Fortran LOGICAL is not the same as Windows return statuses (or C's bool).
I don't understand what problem you see here.
Steve
I don't understand what problem you see here.
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I mostly wonder why Logical(1) is not allowed as a data type in the com server interface.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
At the time the COM Server Wizard was written, Automation did not support an equivalent of LOGICAL(1). It may still not.
Steve
Steve

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page