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

Inherits: Progress.Lang.Object

Copyright (c) 2014, 2017, 2020 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
/* Keep the default in a readonly property - it is 10




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 */
INT64 HexToInt (character) /** Converts hex to integer values @param character A hex value @return int64 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

INT64 HexToInt (character)

Purpose: Converts hex to integer values
Parameters:
pcHex CHARACTER
Returns INT64
int64 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


Copyright © 2022 Progress Software Corporation. All rights Reserved.

Progress® OpenEdge® Release 11.7.15