RADIX(3) - [MODEL:NUMERIC] Base of a numeric model
result = radix(x)
integer function radix(x)TYPE(kind=**),intent(in) :: x(..)
o X may be scalar or an array of any real or integer type. o the result is a default integer scalar.
RADIX(3) returns the base of the internal model representing the numeric entity X.
In a positional numeral system, the radix or base is the number of unique digits, including the digit zero, used to represent numbers.
This function helps to represent the internal computing model generically, but will be 2 (representing a binary machine) for any common platform for all the numeric types.
o X : used to identify the type of number to query.
The returned value indicates what base is internally used to represent the type of numeric value X represents.
Sample program:
program demo_radix implicit none print *, "The radix for the default integer kind is", radix(0) print *, "The radix for the default real kind is", radix(0.0) print *, "The radix for the doubleprecision real kind is", radix(0.0d0) end program demo_radixResults:
> The radix for the default integer kind is 2 > The radix for the default real kind is 2 > The radix for the doubleprecision real kind is 2
Fortran 95
DIGITS(3), EPSILON(3), EXPONENT(3), FRACTION(3), HUGE(3), MAXEXPONENT(3), MINEXPONENT(3), NEAREST(3), PRECISION(3), RANGE(3), RRSPACING(3), SCALE(3), SET_EXPONENT(3), SPACING(3), TINY(3)
Fortran intrinsic descriptions (license: MIT) @urbanjost
Nemo Release 3.1 | radix (3fortran) | November 02, 2024 |