floatcmp
Description:
Function floatcmp used to compare float values to each other, to validate the comparison.
This function name starts with a lowercase letter. |
Parameters:
(Float:oper1, Float:oper2)
float | oper1 | The first float value to compare. |
float | oper2 | The second float value to compare. |
Return Values:
0 if value does match, 1 if the first value is bigger and -1 if the 2nd value is bigger.
Examples:
floatcmp(2.0, 2.0); // Returns 0 because they match. floatcmp(1.0, 2.0) // Returns -1 because the second value is bigger. floatcmp(2.0, 1.0) // Returns 1 because the first value is bigger.
Related Functions
The following functions may be useful, as they are related to this function in one way or another.
- float: Converts an integer into a float.
- floatstr: Converts a string to a float.
- floatmul: Multiplies two floats with each other.
- floatdiv: Divide one float by another one.
- floatadd: Adds two floats together.
- floatsub: Subtracts one float from another.
- floatfract: Get the fractional part of a float.
- floatround: Round a floating point number to an integer value.
- floatsqroot: Calculates the square root of given value.
- floatpower: Raises the given value to the power of the exponent.
- floatlog: Allows you to get the logarithm of a float value.
- floatsin: Get the sine from a given angle.
- floatcos: Get the cosine from a given angle.
- floattan: Get the tangent from a given angle.
- floatabs: Returns the absolute value of float.