]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/fortran/doc/gfortran/compiler-characteristics/internal-representation-of-logical-variables.rst
sphinx: add missing trailing newline
[thirdparty/gcc.git] / gcc / fortran / doc / gfortran / compiler-characteristics / internal-representation-of-logical-variables.rst
CommitLineData
c63539ff
ML
1..
2 Copyright 1988-2022 Free Software Foundation, Inc.
3 This is part of the GCC manual.
4 For copying conditions, see the copyright.rst file.
5
6.. index:: logical, variable representation
7
8.. _internal-representation-of-logical-variables:
9
10Internal representation of LOGICAL variables
11********************************************
12
13The Fortran standard does not specify how variables of ``LOGICAL``
14type are represented, beyond requiring that ``LOGICAL`` variables
15of default kind have the same storage size as default ``INTEGER``
16and ``REAL`` variables. The GNU Fortran internal representation is
17as follows.
18
19A ``LOGICAL(KIND=N)`` variable is represented as an
20``INTEGER(KIND=N)`` variable, however, with only two permissible
21values: ``1`` for ``.TRUE.`` and ``0`` for
22``.FALSE.``. Any other integer value results in undefined behavior.
23
3ed1b4ce 24See also :ref:`argument-passing-conventions` and :ref:`interoperability-with-c`.