dctfix

Decimal Convert To Fixed

dctfix FRT,FRB
dctfix. FRT,FRB

Converts a decimal floating-point number to a fixed-point integer.

Details

The DFP operand in FRB is rounded to an integer value and placed into FRT in the 64-bit signed binary integer format. The sign of the result is the same as the sign of the source operand, except when the source operand is a NaN or a zero.

Pseudocode Operation

if 'dctfix' then
    FRT <- round(FRB)
else if 'dctfix.' then
    FRT <- round(FRB)
    CR1 <- result of comparison

Programming Note

It is recommended that software pre-round the operand to a floating-point integral using drintx[q] or drintn[q] if a rounding mode other than the current rounding mode specified by DRN is needed.

Example

dctfix f1, f3

Encoding

Binary Layout
59
0
FRT
6
/
11
FRB
16
290
21
Rc
31
 
Format X-form
Opcode 0xEC000244
Extension Decimal Floating-Point
Registers Altered FPSCR (FPRF, FR, FI, FX, VXSNAN, VXCVI, XX), CR1 (if Rc=1)

Operands

  • FRT
    Target
  • FRB
    Source