OUT_OF_RANGE (The GNU Fortran Compiler) (original) (raw)

The return value is of type LOGICAL.

If MOLD is of type INTEGER or UNSIGNED, andROUND is absent or present with the value false, the result is true if and only if the value of X is an IEEE infinity or NaN, or if the integer with largest magnitude that lies between zero and Xinclusive is not representable by objects with the type and kind ofMOLD.

If MOLD is of type INTEGER or UNSIGNED, andROUND is present with the value true, the result is true if and only if the value of X is an IEEE infinity or NaN, or if the integer nearest X, or the integer of greater magnitude if two integers are equally near to X, is not representable by objects with the type and kind of MOLD.

Otherwise, the result is true if and only if the value of X is an IEEE infinity or NaN that is not supported by objects of the type and kind ofMOLD, or if X is a finite number and the result of rounding the value of X to the model for the kind of MOLD has magnitude larger than that of the largest finite number with the same sign as X that is representable by objects with the type and kind of MOLD.