Math.Div

Top  Previous  Next

 

Syntax

function Math.Div(Op1, Op2: integer): integer

 

Alternative Names

ibec_Div

 

Description

Performs an integer division, meaning the result is rounded down to the nearest integer value.

 

The Return Value is the result of the value in Op1 being divided by the value in Op2.

 

See Also

Math.Mod

 

Example

execute UDSBlock 

as

begin

  /* divide 10 by 2 

     > 10/5=2 */

  Res = Math.Div(10, 2); 

  GUI.ShowMessage('Result (5): ' || Res);

  

  /* divide 10 by 3 

     > 10/3=3.33333, round down to 3 */

  Res = Math.Div(10, 3); 

  GUI.ShowMessage('Result (3): ' || Res);

end