IMath.IntD

Fore Syntax

IntD(Value: Decimal): Integer;

Fore.NET Syntax

IntD(Value: decimal): integer;

Parameters

Value. Rounded decimal high-precision number.

Description

The IntD method rounds the specified decimal high-precision number to the nearest least integer.

Comments

To define numbers of the Decimal type in the array, it is necessary to write the "m" character after the value of each number. For example: 0.001m.

Available values range for input parameter [MinInteger; MaxInteger]. MinInteger = -231, MaxInteger = 231 - 1.

If input parameter goes beyond the left border of available values, the method returns MinInteger.

If input parameter goes beyond the right border of available values, the method returns MaxInteger.

Fore Example

To execute the example, add a link to the MathFin system assembly.

Sub UserProc;
Var
    r: Integer;
Begin
    r := Math.IntD(4.94513548945145674897m);
    Debug.WriteLine(r);
End Sub UserProc;

After executing the example the console window displays the result of rounding to the nearest least integer equal to 4.

Fore.NET Example

The requirements and result of the Fore.NET example execution match with those in the Fore example.

Imports Prognoz.Platform.Interop.MathFin;

Public Shared Sub Main(Params: StartParams);
Var
    r: integer;
    Math: MathClass = New MathClass();
Begin
    r := Math.IntD(4.94513548945145674897m);
    System.Diagnostics.Debug.WriteLine(r);
End Sub;

See also:

IMath