FORTRAN 77 Language Reference

# Arithmetic Operations on Extreme Values

This section describes the results of basic arithmetic operations with extreme and ordinary values. We assume all inputs are positive, and no traps, overflow, underflow, or other exceptions happen.

Table C-3 Extreme Value Abbreviations

Abbreviation

Meaning

Sub

Subnormal number

Num

Normalized number

Inf

Infinity (positive or negative)

NaN

Not a Number

Uno

Unordered

Table C-4 Extreme Values: Addition and Subtraction

Left Operand

Right Operand

Sub

Num

Inf

NaN

Sub

Num

Inf

NaN

Sub

Sub

Sub

Num

Inf

NaN

Num

Num

Num

Num

Inf

NaN

Inf

Inf

Inf

Inf

Note

NaN

NaN

NaN

NaN

NaN

NaN

NaN

Note: Inf Inf and Inf + Inf = Inf ; Inf - Inf = NaN.

Table C-5 Extreme Values: Multiplication

Left Operand

Right Operand

Sub

Num

Inf

NaN

NaN

NaN

Sub

NS

Inf

NaN

Num

NS

Num

Inf

NaN

Inf

NaN

Inf

Inf

Inf

NaN

NaN

NaN

NaN

NaN

NaN

NaN

In the above table, NS means either Num or Sub result possible.

Table C-6 Extreme Values: Division

Left Operand

Right Operand

Sub

Num

Inf

NaN

NaN

NaN

Sub

Inf

Num

Num

NaN

Num

Inf

Num

Num

NaN

Inf

Inf

Inf

Inf

NaN

NaN

NaN

NaN

NaN

NaN

NaN

NaN

Table C-7 Extreme Values: Comparison

Left Operand

Right Operand

Sub

Num

Inf

NaN

Uno

Sub

Uno

Num

Uno

Inf

Uno

NaN

Uno

Uno

Uno

Uno

Uno

Notes:

• If either X or Y is NaN, then X.NE.Y is .TRUE., and the others (.EQ., .GT., .GE., .LT., .LE.) are .FALSE.

• +0 compares equal to -0.

• If any argument is NaN, then the results of MAX or MIN are undefined.