Attention
IronPLC can only run very simple programs. The steps described are accurate but many language features are not yet supported.
DIV¶
Returns the quotient of two inputs.
IEC 61131-3 |
Section 2.5.1.5.3 |
Support |
Supported |
Signatures¶
# |
Input (IN1) |
Input (IN2) |
Return Type |
Support |
|---|---|---|---|---|
1 |
|
|
|
Supported |
2 |
|
|
|
Supported |
3 |
|
|
|
Supported |
4 |
|
|
|
Supported |
5 |
|
|
|
Supported |
6 |
|
|
|
Supported |
7 |
|
|
|
Supported |
8 |
|
|
|
Supported |
9 |
|
|
|
Supported |
10 |
|
|
|
Supported |
Description¶
Returns IN1 divided by IN2. DIV(a, b) is the functional form
of the / operator: a / b. Both forms are equivalent.
For integer types, division truncates toward zero. Division by zero causes a runtime fault.
Example¶
result := DIV(42, 6); (* result = 7 *)
result := 42 / 6; (* result = 7, operator form *)
result := 7 / 2; (* result = 3, truncates toward zero *)