swirl
Guide to OmniMark 8   OmniMark home
docs home 
IndexConceptsTasksSyntaxLibrariesLegacy LibrariesErrors
 
    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.


Declaration

export overloaded external float function
   abs value float x

export overloaded external bcd function
   abs value bcd x


Purpose

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.

BCD Example:

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
 
 

Top [ INDEX ] [ CONCEPTS ] [ TASKS ] [ SYNTAX ] [ LIBRARIES ] [ LEGACY LIBRARIES ] [ ERRORS ]

OmniMark 8.2.0 Documentation Generated: March 13, 2008 at 3:27:39 pm
If you have any comments about this section of the documentation, please use this form.

Copyright © Stilo International plc, 1988-2008.