Manual Reference Pages  - fraction (3fortran)

NAME

FRACTION(3) - [MODEL:COMPONENTS] Fractional part of the model representation

SYNOPSIS

result = fraction(x)

         elemental real(kind=KIND) function fraction(x)

real(kind=KIND),intent(in) :: fraction

CHARACTERISTICS

o X is of type real
o The result has the same characteristics as the argument.

DESCRIPTION

FRACTION(3) returns the fractional part of the model representation of X.

OPTIONS

o X : The value to interrogate

RESULT

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.

EXAMPLES

Sample program:

    program demo_fraction
    implicit none
    real :: x
       x = 178.1387e-4
       print *, fraction(x), x * radix(x)**(-exponent(x))
    end program demo_fraction

Results:

      >  0.5700439      0.5700439

STANDARD

Fortran 95

SEE ALSO

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
Generated by manServer 1.08 from 0391bde0-003f-4cec-ab86-de36fd4618fa using man macros.