| 1 |
# fraction(x): Fractional Part in Model Representation |
| 2 |
|
| 3 |
Fractional part of the model representation. |
| 4 |
|
| 5 |
## Declaration |
| 6 |
|
| 7 |
### Syntax |
| 8 |
|
| 9 |
```fortran |
| 10 |
retval = fraction(x) |
| 11 |
elemental real(p) function fraction(x) |
| 12 |
``` |
| 13 |
### Arguments |
| 14 |
|
| 15 |
`x` the input value, must be real. |
| 16 |
|
| 17 |
### Return values |
| 18 |
|
| 19 |
The returned value has the kind of the input value. The fractional part of the |
| 20 |
model representation of the input value is returned. |
| 21 |
|
| 22 |
## Description |
| 23 |
|
| 24 |
**fraction(x)** computes the fractional part of the model representation of **x**. |
| 25 |
|
| 26 |
It is calculated using: |
| 27 |
|
| 28 |
$x * {radix(x)}^{(-exponent(x))}$ |
| 29 |
|
| 30 |
## Types |
| 31 |
|
| 32 |
Supported argument type is real. |
| 33 |
|
| 34 |
## Examples |
| 35 |
|
| 36 |
```fortran |
| 37 |
program intrinsics_fraction |
| 38 |
implicit none |
| 39 |
real :: x = 3.0 |
| 40 |
print *, fraction(x) |
| 41 |
end program |
| 42 |
``` |
| 43 |
|
| 44 |
**Result**: |
| 45 |
|
| 46 |
``` |
| 47 |
0.75 |
| 48 |
``` |
| 49 |
|
| 50 |
## See Also |