Floatsub

floatsub

Description:
Function floatsub subtracts one float from another.
This function name starts with a lowercase letter.
This function is rather redundant, for it is no different than the conventional subtraction operator (-).


Parameters:
(Float:oper1, Float:oper2)
float oper1 First Float.
float oper2 Second Float (gets subtracted from the first float.)


Return Values:
The difference of the two given floats.


Examples:
public OnGameModeInit()
{
    new Float:Number1 = 5, Float:Number2 = 2; //Declares two floats, Number1 (5) and Number2 (2)
    new Float:Difference;
    Difference = floatsub(Number1, Number2);//Saves the Difference(5-2 = 3) of Number1 and Number2 in the float "Difference"
    return 1;
}


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.
  • floatfract: Get the fractional part of a float.
  • floatround: Round a floating point number to an integer value.
  • floatcmp: Compare float values to each other, to validate the comparison.
  • 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.