|  | 
 | ||||
|        | |||||
|  | ||||||
| Related Concepts | Other Library Functions | |||||
| operator | abs | 
| Library: Floating point number support (OMFLOAT) Import: omfloat.xmd Library: Binary coded decimal (BCD) numbers (OMBCD) Import: ombcd.xmd | Return type: BCD or float Returns: The absolute value of a specified number. | 
export overloaded external float function abs value float x export overloaded external bcd function abs value bcd x
Use abs to get the absolute value of a  floating point number or BCD number.
To get the absolute value of a BCD number, you must import the ombcd.xmd file in your program. To get the absolute value of a floating point number, import the omfloat.xmd file.
The following program will output "$34.98":
  import "ombcd.xmd" unprefixed
  process
      local bcd price
      set price to -34.98
      output "<$,NNZ.ZZ>" % abs price
| Related Concepts BCD data type Floating point data type | Other Library Functions ** (power) abs ceiling exp floor ln log10 round sqrt truncate | 
Copyright © Stilo International plc, 1988-2008.