[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 Return the absolute value of a numeric expression

     ABS(<nExp>) --> nPositive


     <nExp> is the numeric expression to be evaluated.


     ABS() returns a number representing the absolute value of its argument.
     The return value is a positive number or zero.


     ABS() is a numeric function that determines the magnitude of a numeric
     value independent of its sign.  It lets you, for example, obtain the
     difference between two numbers as a positive value without knowing in
     advance which of the two is larger.

     As a formalism, ABS(x) is defined in terms of its argument, x, as
     follows: if x >= 0, ABS(x) returns x; otherwise, ABS(x) returns the
     negation of x.


     .  These examples show typical results from ABS():

        nNum1 := 100
        nNum2 := 150
        ? nNum1 - nNum2                  // Result: -50
        ? ABS(nNum1 - nNum2)             // Result: 50
        ? ABS(nNum2 - nNum1)             // Result: 50
        ? ABS(-12)                       // Result: 12
        ? ABS(0)                         // Result: 0

 Files   Library is CLIPPER.LIB.

This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson