Namespace: Consultingwerk.Util
Class 
MathHelper Copy to Clipboard
Parent classes:
Inherits: Progress.Lang.Object

File:MathHelper
Purpose:Provides support for mathematical operations
Author(s):Mike Fechner / Consultingwerk Ltd.
Created:Wed Dec 12 20:18:52 CET 2012
Purpose: Disallow instance creation
Notes:



Top Method Summary
Options Name Purpose
+ INT64 And (int64, int64) Performs a bitwise AND operation
+ INT64 Hex2Int (character) Converts a hexdecimal string expression into the Integet value
+ CHARACTER Int2Hex (int64) Converts a hexdecimal string expression into the Integet value
+ LOGICAL IsNumber (character) Returns if the provided string can be converted into an integer number
+ INT64 Not (int64) Performs a bitwise NOT operation
+ INT64 Or (int64, int64) Performs a bitwise OR operation
+ INTEGER Percentage (integer, integer) Returns the percentage of the provided value to the provided whole
+ INT64 Roundup (decimal) Rounds up a number if it's not already an integer
+ INT64 Xor (int64, int64) Performs a bitwise XOR operation

Top Constructor Summary
Options Name Purpose
+ MathHelper () Disallow instance creation


Method Detail
Top

PUBLIC INT64 And (int64, int64)

Purpose: Performs a bitwise AND operation
Notes:

Parameters:
piValue1 INT64
The first operand
piValue2 INT64
The second operand
Returns INT64
The resulting value
Top

PUBLIC INT64 Hex2Int (character)

Purpose: Converts a hexdecimal string expression into the Integet value
Notes:

Parameters:
pcHex CHARACTER
The hexadecimal value
Returns INT64
The resulting integer value
Top

PUBLIC CHARACTER Int2Hex (int64)

Purpose: Converts a hexdecimal string expression into the Integet value
Notes:

Parameters:
piInt INT64
The hexadecimal value
Returns CHARACTER
The resulting integer value
Top

PUBLIC LOGICAL IsNumber (character)

Purpose: Returns if the provided string can be converted into an integer number
Notes:

Parameters:
pcString CHARACTER
The string to verify
Returns LOGICAL
Logical value indicating if the value can be converted into a number
Top

PUBLIC INT64 Not (int64)

Purpose: Performs a bitwise NOT operation
Notes:

Parameters:
piValue INT64
The value to be processed
Returns INT64
The resulting value
Top

PUBLIC INT64 Or (int64, int64)

Purpose: Performs a bitwise OR operation
Notes:

Parameters:
piValue1 INT64
The first operand
piValue2 INT64
The second operand
Returns INT64
The resulting value
Top

PUBLIC INTEGER Percentage (integer, integer)

Purpose: Returns the percentage of the provided value to the provided whole
Notes: The result will never exceed 100%, even when the value is higher than
the whole

Parameters:
piValue INTEGER
The (smaller) value
piWhole INTEGER
The whole (100%) value
Returns INTEGER
The percentage value
Top

PUBLIC INT64 Roundup (decimal)

Purpose: Rounds up a number if it's not already an integer
Notes: Negative numbers will actually be rounded down, i.o.w. Roundup (-1.5)
will return -2, so that the absolute value will be rounded up

Parameters:
pdeNumber DECIMAL
The number to round up
Returns INT64
The rounded value
Top

PUBLIC INT64 Xor (int64, int64)

Purpose: Performs a bitwise XOR operation
Notes:

Parameters:
piValue1 INT64
The first operand
piValue2 INT64
The second operand
Returns INT64
The resulting value


Constructor Detail
Top

PUBLIC MathHelper ()

Purpose: Disallow instance creation
Notes:



©2006-2023 Consultingwerk Ltd.         info@consultingwerk.de         http://www.consultingwerk.de       15.04.2024 06:16:56