- expressionIf you supply a negative value for the variable fx, the r-uneg.p procedure uses the unary negative operator (-) to reverse the sign of fx, producing the absolute value of fx (fabs-x).
DEFINE VARIABLE fx AS DECIMAL NO-UNDO LABEL "X".DEFINE VARIABLE fabs-x AS DECIMAL NO-UNDO LABEL "ABS(X)".REPEAT:SET fx.IF fx < 0 THENfabs-x = -fx.ELSEfabs-x = fx.DISPLAY fabs-x.END.
© 2013 Progress Software Corporation and/or its subsidiaries or affiliates. |