Unit NpsMath

Classes

Functions

AbsoluteToPercent - function AbsoluteToPercent returns Fraction/FullSize as a percent

convert and round
Assert - procedure Assert if Condition is False, throws the given exception type with the given message attached to it.
AssertFMT - procedure AssertFMT if Condition is False, throws the given exception type with a message created from the Message and Args parameters
Between - ********************************** * Проверка на вхождение в диапазон *
Max -
Min -
PercentToAbsolute - function PercentToAbsolute returns the given percentage of FullSize
Sign -
SortStrings - procedure SortStrings sorts the given list using the SortFunc to order the elements
SwapInt - ********************************** * Проверка на вхождение в диапазон *
SwapLong -

Types

TPercentRange
TSortStringsFunc

Constants

Variables


Functions


function AbsoluteToPercent(Fraction, FullSize: Integer): TPercentRange;

function AbsoluteToPercent returns Fraction/FullSize as a percent

convert and round


procedure Assert(Condition: Boolean; Message: String; ExceptionType: ExceptClass);

procedure Assert if Condition is False, throws the given exception type with the given message attached to it.

use floating point arithmetic to implement conversion


procedure AssertFMT(Condition: Boolean; Message: String; const Args: Array of Const; ExceptionType: ExceptClass);

procedure AssertFMT if Condition is False, throws the given exception type with a message created from the Message and Args parameters

function Between(Check,Left,Right:Integer) : Boolean;

********************************** * Проверка на вхождение в диапазон *

function Max(A,B:Integer) : Integer;


function Min(A,B:Integer) : Integer;


function PercentToAbsolute(Percentage: Integer; FullSize: Integer): Integer;

function PercentToAbsolute returns the given percentage of FullSize

function Sign(A:Integer) : Integer;


procedure SortStrings(List: TStrings; SortFunc: TSortStringsFunc);

procedure SortStrings sorts the given list using the SortFunc to order the elements

procedure SwapInt(var Left,Right:Integer);

********************************** * Проверка на вхождение в диапазон *

procedure SwapLong(var Left,Right:Integer);


Types


TPercentRange =     0 .. 100
range for percentage values
TSortStringsFunc = function (List: TStrings; Index1, Index2: Integer): Integer
callback function type for sorting strings should return > 0 if the element at Index1 > element at Index2 = 0 if they are equal < 0 if the element at Index1 < element at Index2

Constants


Variables