start of change

Quantize Decimal Floating-Point by Example (QUANTIZEBE)

Bound program access

Built-in number for QUANTIZE64 is 712. QUANTIZE64 ( source : decimal floating-point(8) example : decimal floating-point(8) round-mode : unsigned binary(4) ) : decimal floating-point(8) /* result */

Bound program access

Built-in number for QUANTIZE128 is 714. QUANTIZE128 ( source : decimal floating-point(16) example : decimal floating-point(16) round-mode : unsigned binary(4) ) : decimal floating-point(16) /* result */

Description

The decimal floating-point source operand value is converted and rounded to a decimal floating-point form having the same exponent as the decimal floating-point value provided by the example operand (known in this case as the exemplary quantum).

The sign and length of the result is identical to that of the source operand value.

Rounding is performed according to the round-mode operand which must be specified as a literal and have one of the following values:

0 Round to nearest, ties to even
1 Round toward zero
2 Round to nearest, ties away from zero
3 Round according to current decimal floating-point rounding mode

When the value of the source exceeds (10p - 1) × 10q, where p is the precision of source and q is the exponent provided by exemplary quantum, a floating-point invalid operand  (hex 0C09) exception is signalled.

When the delivered result differs in value from the source, a floating-point inexact result  (hex 0C0D) exception is signalled. No underflow operation is signalled by this operation, regardless of the value of the source.

If either the source or the example contains an SNaN, the result is a QNaN and a floating-point invalid operand  (hex 0C09) exception is signalled. Otherwise, if either the source or the example contains a QNaN, the result is a QNaN and no exception is signalled.

When both the source and the example contain infinities, the result is a default infinity. Otherwise, if either the source or the example contains an infinity, the result is a default QNaN and a floating-point invalid operand  (hex 0C09) exception is signalled.

When the source value is zero, the result is the form of zero having the specified exemplary quantum.

When conditions occur that cause a floating-point invalid operand  (hex 0C09) exception to be signalled but the exception is disabled, the result of the operation is the corresponding QNaN.

Authorization Required

Lock Enforcement

Exceptions

0C Computation

end of change