Floatdiv

From SA-MP Wiki

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

← Previous diff
Current revision
Freaksken (Talk | contribs)
(Add redundant note)
Line 3: Line 3:
{{LowercaseFunction|floatdiv}} {{LowercaseFunction|floatdiv}}
-{{Description|Divide one float by another one. Redundant as the division operator (/) does the same thing.}}+{{Description|Divide one float by another one.}}
 + 
 +{{Note|This function is rather redundant, for it is no different than the conventional division operator (/).}}
{{Parameters|Float:dividend, Float:divisor}} {{Parameters|Float:dividend, Float:divisor}}

Current revision


floatdiv

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


Description:

Divide one float by another one.


Image:32px-Ambox_warning_orange.png

Note

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


Parameters:
(Float:dividend, Float:divisor)
Float:dividendFirst float.
Float:divisorSecond float (dividates the first float.)


Return Values:

The quotient of the two given floats.


Example Usage:

public OnGameModeInit()
{
    new Float:Number1 = 8.05, Float:Number2 = 3.5; //Declares two floats, Number1 (8.05) and Number2 (3.5)
    new Float:Quotient;
    Quotient = floatdiv(Number1, Number2);       //Saves the quotient(=8.05/3.5 = 2.3) of Number1 and Number2 in the float "Quotient"
    return 1;
}

Related Functions

The following functions may be helpful as they relate to this function in one way or another.

  • floatsub: Subtract a float from another float.
Personal tools