Floatsub

From SA-MP Wiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 16:07, 26 April 2014
MP2 (Talk | contribs)

← Previous diff
Current revision
Freaksken (Talk | contribs)
(Add redundant note)
Line 3: Line 3:
{{LowercaseFunction|floatsub}} {{LowercaseFunction|floatsub}}
-{{Description|Subtracts one float from another one. Note that this function has no real use, as one can simply use the standard operator (-) instead.}}+{{Description|Subtracts one float from another.}}
 + 
 +{{Note|This function is rather redundant, for it is no different than the conventional subtraction operator (-).}}
{{Parameters|Float:oper1, Float:oper2}} {{Parameters|Float:oper1, Float:oper2}}

Current revision


floatsub

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


Description:

Subtracts one float from another.


Image:32px-Ambox_warning_orange.png

Note

This function is rather redundant, for it is no different than the conventional subtraction operator (-).


Parameters:
(Float:oper1, Float:oper2)
oper1First Float.
oper2Second 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 helpful as they relate to this function in one way or another.

Personal tools