Namespace: OpenEdge.Core.Util
Type: Class MathUtil
Parent Classes:
Progress.Lang.Object

Inherits: Progress.Lang.Object


Copyright (c) 2014, 2017 by Progress Software Corporation. All rights reserved.
File:MathUtil
Purpose:General-purpose math functionality.
Author(s):pjudge
Created:Thu May 15 14:44:19 EDT 2014



Method Summary
  Options Name Purpose
  INTEGER Ceiling (decimal) /** Return a ceiling value (a always-round-up value). So, 2.1 returns 3 1.9 returns 2 5.0 returns 5 @param decimal The value to adjust @return integer The ceiling value */
  DECIMAL ExponentialToDec (character) /** Converts an exponent (123e4) value into a decimal using a exponent base of 10. @param character The exponent value @param decimal The converted value */
  DECIMAL ExponentialToDec (character, integer) /** Converts an exponent (123e4) value into a decimal. The format is nnn[.nnn]e[-]nnn <base>e<exponent> The <exponent> is raised as a power of the exponent-base. @param character The exponent value @param integer The exponent base. Must be a positive value (>0) @param decimal The converted value */
  INTEGER HexToInt (character) /** Converts hex to integer values @param character A hex value @return integer The integer representation of that hex value. */
  CHARACTER IntToHex (integer, integer) /** Converts an integer to a padded hax values @param integer An integer value @param integer The total length of the hex value. If the integer hex value is larger than this, use the larger and padd with leading zeros @return character A hex value */

Property Summary
  Options Name Purpose
  INTEGER DEFAULT_BASE


Method Detail
Top

INTEGER Ceiling (decimal)

Purpose: Return a ceiling value (a always-round-up value).
So,
2.1 returns 3
1.9 returns 2
5.0 returns 5
Parameters:
pdVal DECIMAL
 
Returns INTEGER
  integer The ceiling value
Top

DECIMAL ExponentialToDec (character)

Purpose: Converts an exponent (123e4) value into a decimal using a exponent
base of 10.
Parameters:
pExpVal CHARACTER
 
Returns DECIMAL
 
Top

DECIMAL ExponentialToDec (character, integer)

Purpose: Converts an exponent (123e4) value into a decimal.
The format is
nnn[.nnn]e[-]nnn
<base>e<exponent>
The <exponent> is raised as a power of the exponent-base.
Parameters:
pExpVal CHARACTER
 
pBase INTEGER
 
Returns DECIMAL
 
Top

INTEGER HexToInt (character)

Purpose: Converts hex to integer values
Parameters:
pcHex CHARACTER
 
Returns INTEGER
  integer The integer representation of that hex value.
Top

CHARACTER IntToHex (integer, integer)

Purpose: Converts an integer to a padded hax values
use the larger and padd with leading zeros
Parameters:
pValue INTEGER
 
pPadding INTEGER
 
Returns CHARACTER
  character A hex value


Property Detail
Top

INTEGER DEFAULT_BASE

Returns INTEGER