MAXEXPONENT(3) - [MODEL:NUMERIC] Maximum exponent of a real kind
result = maxexponent(x)
elemental integer function maxexponent(x)real(kind=**),intent(in) :: x
o X is a real scalar or array of any real kind o the result is a default integer scalar
MAXEXPONENT(3) returns the maximum exponent in the model of the type of X.
o X : A value used to select the kind of real to return a value for.
The value returned is the maximum exponent for the kind of the value queried
Sample program:
program demo_maxexponent use, intrinsic :: iso_fortran_env, only : real32,real64,real128 implicit none character(len=*),parameter :: g=(*(g0,1x)) print g, minexponent(0.0_real32), maxexponent(0.0_real32) print g, minexponent(0.0_real64), maxexponent(0.0_real64) print g, minexponent(0.0_real128), maxexponent(0.0_real128) end program demo_maxexponentResults:
> -125 128 > -1021 1024 > -16381 16384
Fortran 95
DIGITS(3), EPSILON(3), EXPONENT(3), FRACTION(3), HUGE(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 (license: MIT) @urbanjost
Nemo Release 3.1 | maxexponent (3fortran) | November 02, 2024 |