Quantize Decimal Floating-point By Value (QUANTIZEBV)
Instruction Syntax
Bound Program Access |
---|
|
Bound Program Access |
---|
|
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 an SNaN, 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, an invalid floating-point conversion (hex 0C0C) 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 or an invalid floating-point conversion (hex 0C0C) exception to be signalled but the exception is disabled, the result of the operation is a QNaN.
Authorization Required
- None
Lock Enforcement
- None
Exceptions
- 0C Computation
- 0C09 Floating-Point Invalid Operand
- 0C0C Invalid Floating-Point Conversion
- 0C0D Floating-Point Inexact Result