Compare Numeric Value (CMPNV)


Op Code (Hex) Extender Operand 1 Operand 2 Operand 3 [4-6]
CMPNVB 1C46 Branch options Compare operand 1 Compare operand 2 Branch targets


CMPNVI 1846 Indicator options Compare operand 1 Compare operand 2 Indicator targets
Operand 1: Numeric scalar.

Operand 2: Numeric scalar.

Operand 3 [4-6]:

Description  The numeric value of the first compare operand is compared with the signed or unsigned numeric value of the second compare operand. Based on the comparison, the resulting condition is used with the extender field to:

Both the compare operands must be numeric with any implicit conversions occurring according to the rules of arithmetic operations as outlined in Arithmetic Operations. For a decimal operation, alignment of the assumed decimal point takes place by padding with 0's on the right end of the compare operand with lesser precision.

Decimal operands used in floating-point operations cannot contain more than 15 total digit positions.

When both operands are signed numeric or both are unsigned numeric, the length of the operation is equal to the length of the longer of the two compare operands. The shorter of the two operands is adjusted to the length of the longer operand according to the rules of arithmetic operations outlined in Arithmetic Operations.

When one operand is signed numeric and the other operand unsigned numeric, the unsigned operand is converted to a signed value with more precision than its current size. The length of the operation is equal to the length of the longer of the two compare operands. A negative signed numeric value will always be less than a positive unsigned value.

Floating-point comparisons use exponent comparison and significand comparison. For a denormalized floating-point number, the comparison is performed as if the denormalized number had first been normalized.

For floating-point, two values compare unordered when at least one comparand is NaN. Every NaN compares unordered with everything including another NaN value.

Floating-point comparisons ignore the sign of zero. Positive zero always compares equal with negative zero.

A floating-point invalid operand  (hex 0C09) exception is signaled when two floating-point values compare unordered and no branch or indicator option exists for any of the unordered, negation of unordered, equal, or negation of equal resultant conditions.

When a comparison is made between a floating-point compare operand and a fixed-point decimal compare operand that contains fractional digit positions, a floating-point inexact result  (hex 0C0D) exception may be signaled because of the implicit conversion from decimal to floating-point.

Resultant Conditions 

Authorization Required

Lock Enforcement

Exceptions

06 Addressing

08 Argument/Parameter

0C Computation

10 Damage Encountered

1C Machine-Dependent

20 Machine Support

22 Object Access

24 Pointer Specification

2C Program Execution

2E Resource Control Limit

36 Space Management

44 Protection Violation