RADIX intrinsic function
Standard: F77 F90 F95 F2003 F2008
 Example Program
<Syntax>
RADIX ( X )

X : Integer or Real;
Result : Scalar Integer of default kind.
<Semantics>

This function returns the radix used in the model for number of the type and kind of X.

This is an inquiry function, so X need not be defined; indeed, it is permitted to be disassociated, unallocated, or absent.

The model for integer type is as a sign together with DIGITS(X) digits of radix RADIX(X); all current machines with a Fortran compiler use binary integer arithmetic, so this has the value 2.

The model for real type is that it may be zero or a signed fraction between 1 and 1/RADIX(X) consisting of DIGITS(X) digits, multiplied by an exponent RADIX(X)**e with MINEXPONENT(X)eMAXEXPONENT(X). Most current machines with a Fortran compiler use binary floating-point arithmetic, and on those machines RADIX(X) will have the value 2. IBM OS/390 machines have both binary and hexadecimal floating-point available; in hexadecimal mode RADIX(X) will have the value 16. IEEE has recently standardised decimal floating-point arithmetic; currently there is not much hardware or software support for this, but when it becomes available such kinds of REAL will have radix 10.

<Related>
DIGITS intrinsic function, HUGE intrinsic function, INTEGER type, MAXEXPONENT intrinsic function, MINEXPONENT intrinsic function, PRECISION intrinsic function, REAL type, TINY intrinsic function