Floatsub
From SA-MP Wiki
floatsub
Note: This function name starts with a lowercase letter. |
Description:
Subtracts one float from another one. Note that this function has no real use, as one can simply use the standard operator (-) instead.
(Float:oper1, Float:oper2)
oper1 | First Float. |
oper2 | Second Float (gets subtracted from the first float.) |
Return Values:
The difference of the two given floats.
Example Usage:
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.
- Floatadd: Adds two floats.
- Floatmul: Multiplies two floats.
- Floatdiv: Divides a float by another.