XenoGuard Documentation

Power

Actions » Programming » Number Operation » Basic » Power 

The action Power raises the value of the base to the specified power exponent and stores the raised number in Result of the Result List. Only the Floating Point data type is allowed.




[-] Hide
  1. Open the Programming node in the Workspace Explorer.
  2. Open the Number Operation node.
  3. In the Basic node, select the Power action.

Parameters:

The action has the following input parameters:


name Description
Number Type
Specifies the data type to be used for the numbers raised to a certain value.

Allowed Context Scope
 [Fixed]
Allowed Value [Floating Point, Signed Number, Unsigned Number]
Base The number to be raised on a specified power.

Allowed Context Scopes
[Fixed, Local, Global]
Allowed Context Types [Variable, Parameter, Enum]
Exponent The number that specifies the power.

Allowed Context Scopes
[Fixed, Local, Global]
Allowed Context Types [Variable, Parameter, Enum]

Results:

The action returns the following results:


name
description
Result Contains the number raised on a specified power.

Allowed Context Scopes [Fixed, Local, Global]
Allowed Context Types [Variable, Parameter]

Warning The number type set in the action Power determines the data type of its Result even if the variables and/or parameters that were set for base and exponent are of different data types.

Example 1 (Raised the Power of a Variable):

This example raises the contents of a local variable, Tile Side, that has the data type Floating Point. The raised value of the local variable is then output via the Message Box.

Example 2 (Convert Scientific Notation to Standard Notation):

This example uses the Power action to convert the contents of a local variable, Measure, that has the Floating Point data type, to a standard notation. The specified number was multiplied to 10 raised to the 3rd power and then output via a Write Text


See other actions:

Add
Subtract
Multiplicate
Divide
Modulo
Root
Increment
Decrement
Random