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.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.