IMath.Even

Fore Syntax

Even(Value: Double): Integer;

Fore.NET Syntax

Even(Value: double): integer;

Parameters

Value. Rounded value.

Description

The Even method rounds the specified value to the nearest even integer.

Comments

If the Value value is positive, the value is rounded up, if it is negative, the value is rounded down.

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

Fore Example

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

Sub UserProc;
Var
    r: Integer;
Begin
    r := Math.Even(1.5);
    Debug.WriteLine(r);
End Sub UserProc;

After executing the example the console window displays the result of rounding to the nearest even integer equal to 2.

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.Even(1.5);
    System.Diagnostics.Debug.WriteLine(r);
End Sub;

See also:

IMath