6.1.3.4.7 EXPT
Function
Exponentiation ( ** ), calculates the result using the value of input IN1 as the base and the value of input IN2 as the power. The result is placed in the output OUT
LD Graphics
Parameter description
| Interface variable | Declaration | Data type | Description |
|---|---|---|---|
| IN1 | Var_Input | ANY_NUM | Base |
| IN2 | Var_Input | ANY_NUM | Index |
| OUT | Var_Output | ANY_NUM | OUT:=IN1**IN2 |
Example
The EXPT instruction uses variable a as the base and variable b as the exponent to obtain variable c, as shown in the figure below: three INT type variables are defined, and the EXPT instruction is executed by compiling, downloading, and realizing the result of variable c

warning
- In EXPT, the type of IN1 is ANY_REAL, and the type of IN2 is ANY_NUM. The output should be of the same type as IN1