FRACTION(3) - [MODEL:COMPONENTS] Fractional part of the model representation
result = fraction(x)
elemental real(kind=KIND) function fraction(x)real(kind=KIND),intent(in) :: fraction
o X is of type real o The result has the same characteristics as the argument.
FRACTION(3) returns the fractional part of the model representation of X.
o X : The value to interrogate
The fractional part of the model representation of X is returned; it is
x * radix(x)**(-exponent(x))If X has the value zero, the result is zero.
If X is an IEEE NaN, the result is that NaN.
If X is an IEEE infinity, the result is an IEEE NaN.
Sample program:
program demo_fraction implicit none real :: x x = 178.1387e-4 print *, fraction(x), x * radix(x)**(-exponent(x)) end program demo_fractionResults:
> 0.5700439 0.5700439
Fortran 95
DIGITS(3), EPSILON(3), EXPONENT(3), HUGE(3), MAXEXPONENT(3), MINEXPONENT(3), NEAREST(3), PRECISION(3), RADIX(3), RANGE(3), RRSPACING(3), SCALE(3), SET_EXPONENT(3), SPACING(3), TINY(3)
Fortran intrinsic descriptions
Nemo Release 3.1 | fraction (3fortran) | November 02, 2024 |