ParaMonte Fortran 2.0.0
Parallel Monte Carlo and Machine Learning Library
See the latest version documentation. |
This is the abstract
derived type for creating objects of class model_type that contain the characteristics of the processor representation model used for the requested data object.
More...
Public Attributes | |
integer(IK) | kind |
The scalar integer of default kind IK, representing the processor-dependent kind type-parameter of data type of interest.More... | |
integer(IK) | storage_size |
The scalar integer of default kind IK, whose value is the size, in bits, that would be taken in memory by a scalar of the same type and kind as the data type of interest.More... | |
This is the abstract
derived type for creating objects of class model_type that contain the characteristics of the processor representation model used for the requested data object.
The Fortran standard recognizes three data representation models:
The Fortran standard (2023) defines intrinsic procedures for manipulating bits held within integers.
They are based on a model in which an integer holds \(s\) bits \(\{w_k : k = 0, \ldots, s - 1\}\), in a sequence from right to left, based on the non-negative value,
\begin{equation} \sum^{s - 1}_{k = 0} w_k \times 2^k ~. \end{equation}
This model is valid only in the context of the standard bit-manipulation intrinsic procedures.
It is identical to the model for integer
data object described below when radix \(r = 2\) and \(w_{s - 1} = 0\) (corresponding to the integer-sign bit).
However, when \(r /= 2\) or when \(w_{s - 1} = 1\) the models do not correspond, and the value expressed as an integer may vary from processor to processor.
The standard Fortran numeric inquiry and manipulation functions are defined in terms of a model set of integers for each kind of integer data type implemented.
For each kind of integer
type, the model set is,
\begin{equation} i = s \times \sum^{q}_{k = 1} w_k \times r^{k - 1} ~, \end{equation}
where,
sing()
),radix()
),real
mantissa) bits (returned by the intrinsic digits()
),The standard Fortran numeric inquiry and manipulation functions are defined in terms of a model set of integers for each kind of real data type implemented.
For each kind of real
type, the model set is,
\begin{equation} x = \begin{cases} 0, \\ s \times b^e \times \sum^{p}_{k = 1} f_k \times b^{-k} ~, \end{cases} \end{equation}
where,
sing()
),radix()
),digits()
),real
value (returned by the intrinsic exponent()
),Values of the parameters in these models are chosen for the processor so as best to fit the hardware with the proviso that all model numbers are representable.
It is likely that there are some machine numbers that lie outside the model.
For example, many computers represent the integer \(-r^q\), and the IEEE standard for floating-point arithmetic (ISO/IEC/IEEE 60559:2011
) contains reals with \(f_1 = 0\) (called subnormal numbers) and register numbers with increased precision and range.
Possible calling interfaces ⛓
Final Remarks ⛓
If you believe this algorithm or its documentation can be improved, we appreciate your contribution and help to edit this page's documentation and source file on GitHub.
For details on the naming abbreviations, see this page.
For details on the naming conventions, see this page.
This software is distributed under the MIT license with additional terms outlined below.
This software is available to the public under a highly permissive license.
Help us justify its continued development and maintenance by acknowledging its benefit to society, distributing it, and contributing to it.
Definition at line 1504 of file pm_kind.F90.
integer(IK) pm_kind::model_type::kind |
The scalar integer
of default kind IK, representing the processor-dependent kind
type-parameter of data type of interest.
Definition at line 1505 of file pm_kind.F90.
integer(IK) pm_kind::model_type::storage_size |
The scalar integer
of default kind IK, whose value is the size, in bits, that would be taken in memory by a scalar of the same type and kind as the data type of interest.
Definition at line 1506 of file pm_kind.F90.