Chapter 4. Ladder Diagram (LD) Programming194 PACSystems* RX7i, RX3i and RSTi-EP CPU Programmer's Reference Manual GFK-2950C4.10.4 DivideWhen the DIV function receives power flow, it divides the operand IN1 by theoperand IN2 of the same data type as IN1 and stores the quotient in theoutput variable assigned to Q, also of the same data type as IN1 and IN2.The power flow output is energized when DIV is performed, unless an invalidoperation or Overflow occurs. (For more information, refer to the section onOverflow.)Mnemonics:DIV_DINTDIV_INTDIV_MIXEDDIV_REALDIV_LREALDIV_UINTNotes:▪ DIV rounds down; it does not round to the closest integer. For example,24 DIV 5 = 4.▪ DIV_MIXED uses mixed data types.▪ Be careful to avoid overflows.The following REAL and LREAL operations are invalid for DIV:▪ Any number divided by 0. This operation yields a result of 65535.▪ ∞ divided by ∞▪ I1 and/or I2 is NaN (Not a Number)Mnemonic Operation Displays asDIV_UINT Q(16-bit) = IN1(16-bit) / IN2(16-bit) base 10 number, unsigned, up to 5 digits longDIV_INT Q(16-bit) = IN1(16-bit) / IN2(16-bit) base 10 number with sign, up to 5 digits longDIV_DINT Q(32-bit) = IN1(32-bit) / IN2(32-bit) base 10 number with sign, up to 10 digits longDIV_MIXED Q(16-bit) = IN1(32-bit) / IN2(16-bit) base 10 number with sign, up to 5 digits longDIV_REAL Q(32-bit) = IN1(32-bit) / IN2(32-bit) base 10 number, sign and decimals, up to 8 digits long(excluding the decimals)DIV_LREAL Q(64-bit) = IN1(64-bit) / IN2(64-bit) base 10 number, sign and decimals, up to 17 digits long(excluding the decimals)Operands for the DIV FunctionParameter Description Allowed Operands OptionalIN1 Dividend: the value to be divided; shown to the left of DIV inthe equation IN1 DIV IN2=Q.All except S, SA, SB, SC NoIN2 Divisor: the value to divide into IN1; shown to the right of DIVin the equation IN1 DIV IN2=Q.All except S, SA, SB, SC NoQ The quotient of IN1/IN2. If a DIV operation on signed operandsresults in Overflow, Q is set to the largest possible value andthere is no power flow.If a DIV_UINT operation results in Overflow, Q wraps around.All except S, SA, SB, SCand constantNo