libsim
Versione7.1.6
|
Definition of constants to be used for declaring variables of a desired type. Continua...
Attributi pubblici | |
integer, parameter | int_b = SELECTED_INT_KIND(1) |
1-byte integer (byte) Continua... | |
integer, parameter | int_s = SELECTED_INT_KIND(4) |
2-byte integer (short) Continua... | |
integer, parameter | int_l = SELECTED_INT_KIND(8) |
4-byte integer (long) Continua... | |
integer, parameter | int_ll = ( ( ( 1 + SIGN( 1, int_ll_t ) ) / 2 ) * int_ll_t ) + ( ( ( 1 - SIGN( 1, int_ll_t ) ) / 2 ) * int_l ) |
8-byte integer (long long) if supported, otherwise 4-byte integer Continua... | |
integer, parameter | fp_s = SELECTED_REAL_KIND(6) |
single precision floating point (4 byte IEEE) Continua... | |
integer, parameter | fp_d = SELECTED_REAL_KIND(15) |
double precision floating point (8 byte IEEE) Continua... | |
integer, parameter | fp_q = ( ( ( 1 + SIGN( 1, fp_q_t ) ) / 2 ) * fp_q_t ) + ( ( ( 1 - SIGN( 1, fp_q_t ) ) / 2 ) * fp_d ) |
quad precision floating point (16 byte IEEE) if supported, otherwise double precision floating point Continua... | |
integer, parameter | ptr_c = int_ll |
kind for an integer having the same size of a C pointer Continua... | |
Definition of constants to be used for declaring variables of a desired type.
This module defines constants that can be portably used when declaring variables (through the KIND
attribute) and when defining constants (through the underscore character _
) in order to be sure that the desired type is used.
There is a subtle difference between platform-default single and double precision real, obtained by declaring a variable of type REAL
or DOUBLE
PRECISION
respectively, and single and double precision IEEE (4 and 8 bytes respectively) which are the standard IEEE data types and which are declared through REAL
(kind=fp_s) and REAL
(kind=fp_d) respectively: these two pairs of types usually coincide, but it may be not the case on some platforms, so you should choose one or the other approach depending on situation.
Example of typical use: