Floatsqroot

From SA-MP Wiki

Jump to: navigation, search

floatsqroot

Image:Farm-Fresh text lowercase.png Note: This function name starts with a lowercase letter.


Description:

Calculates the square root of given value.


Parameters:
(Float:value)
valueThe value to calculate the square root of.


Return Values:

The square root of the input value, as a float.


Image:32px-Ambox_warning_orange.png

Note

This function raises a “domain” error if the input value is negative. You may use floatabs to get the absolute (positive) value.


Example Usage:

floatsqroot(25.0); // Returns 5, because 5x5 = 25

Related Functions

The following functions may be useful, as they are related to this function in one way or another.

  • floatpower: Raises given value to a power of exponent.
  • floatlog: Get the logarithm of the float value.