IMath.Ceiling

Fore Syntax

Ceiling(Value: Double; Precision: Double): Double;

Fore.NET Syntax

Ceiling(Value: double; Precision: double): double;

Parameters

Value. Rounded real number.

Precision. The multiple, up to which the value must be rounded.

Description

The Ceiling method rounds up the number to the nearest number, which is a multiple of precision.

Comments

Parameter values cannot be empty.

If a number and precision are positive, the value is rounded up.

If a number and precision are negative, the value is rounded up.

If a number is negative and precision is positive, the value is rounded up.

Fore Example

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

Sub UserProc;
Var
    r1, r2, r3: Double;
Begin
    r1 := Math.Ceiling(1.5,0.1);
    Debug.WriteLine(r1);
    r2 := Math.Ceiling(-2.5,-2);
    Debug.WriteLine(r2);
    r3 := Math.Ceiling(-2.5,2);
    Debug.WriteLine(r3);
End Sub UserProc;

After executing the example the console window displays rounding results:

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
    
r1, r2, r3: double;
    Math: MathClass = New MathClass();
Begin
    r1 := Math.Ceiling(1.5,0.1);
    System.Diagnostics.Debug.WriteLine(r1);

    r2 := Math.Ceiling(-2.5,-2);
    System.Diagnostics.Debug.WriteLine(r2);
    r3 := Math.Ceiling(-2.5,2);
    System.Diagnostics.Debug.WriteLine(r3);
End Sub;

See also:

IMath