sqr

Returns val*val.

Syntax:

GML Code Example

sqr(val);


Argument Description
val The number to square.


Returns: Real


Description

Multiplies a number by itself and so returns the square of that number. EG: sqr(5) would return 25 since 5*5=25.


Example:

GML Code Example

score += sqr(dmg);

The above code will add on the square of the variable "dmg" to the score.





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