power

Returns the given number to the given power; the number x multiplied by itself n number of times.

Syntax:

GML Code Example

power(x, n);


Argument Description
x The number to change.
n How many times to multiply x by itself.


Returns: Real


Description

This will return the value of a number multiplied by itself "n" number of times. For example, power(5,3) will multiply 5 by itself 3 times and return 125, which is the same as saying 5*5*5=125. Please note that the "x" value (the number to change) cannot be a negative value.


Example:

GML Code Example

score += power(dmg, 3);

This will add the value of held in the variable "dmg" to the power of 3 to the score variable.





No Examples Submitted

Does this page need better examples? Be the first to Submit

No Edits Suggested

Is this page unclear or not descriptive enough? Suggest an edit to the page and with enough upvotes your changes will be made.

No Questions Have Been Ask

Do you have a question about this page? Ask it Here