sqrt

Returns the square root of val. Val cannot be a negative value.

Syntax:

GML Code Example

sqrt(val);


Argument Description
val The number to get the square root of.


Returns: Real


Description

If you multiply a number with itself, you get the square of that number, but sometimes you want to do the reverse and get the square root of a number. So to find what number has been multiplied with itself to get any given positive value we use this function. For example: sqrt(9) will return 3 since 3*3=9.


Example:

GML Code Example

num = sqrt(exp);

The above code will set the variable "num" to hold the square root of the value contained in "exp".





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