**********************************************************
***** ルート計算 *****
**********************************************************
A-ROOT-RTN.
DIVIDE 2 INTO WK-INPUT GIVING WK-SYO
REMAINDER WK-AMARI.
MOVE WK-SYO TO WK-ROOTCNT.
IF WK-AMARI NOT = ZERO
ADD 1 TO WK-ROOTCNT.
MOVE WK-INPUT TO WK-Z WK-Y.
PERFORM
VARYING WK-TS4 FROM 1 BY 1
UNTIL WK-TS4 > WK-ROOTCNT
COMPUTE WK-Z = (WK-Z + WK-Y / WK-Z) / 2
END-PERFORM.
MOVE WK-Z TO WK-OUTPUT.
A-ROOT-EXT.
EXIT.