start of change

Quantize Decimal Floating-Point by Value (QUANTIZEBV)

Bound program access

Built-in number for QUANTIZE64I is 713. QUANTIZE64I ( source : decimal floating-point(8) quantum : signed binary(4) round-mode : unsigned binary(4) ) : decimal floating-point(8) /* result */

Bound program access

Built-in number for QUANTIZE128I is 715. QUANTIZE128I ( source : decimal floating-point(16) quantum : signed binary(4) 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 value as that directly supplied by the quantum integer operand value.

The quantum operand must be a literal value in the range of -16 to 15, inclusive.

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 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 the source contains a SNaN, the result is a QNaN and a floating-point invalid operand  (hex 0C09) exception is signalled. Otherwise, if the source operand contains a QNaN, the result is a QNaN and no exception is signalled.

If the source operand 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 quantum value.

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