Quantize Decimal Floating-point By Value (QUANTIZEBV)

Instruction Syntax

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.

Start of changeIf 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. End of change

Start of changeIf the source operand contains an infinity, an invalid floating-point conversion (hex 0C0C) exception is signalled. End of change

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

Start of changeWhen 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. End of change

Authorization Required

  • None

Lock Enforcement

  • None

Exceptions

  • 0C Computation
    • 0C09 Floating-Point Invalid Operand
    • Start of change0C0C Invalid Floating-Point ConversionEnd of change
    • 0C0D Floating-Point Inexact Result