a / b: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "‎" to "")
m (Fix)
 
Line 29: Line 29:


|descr= Returns the quotient of two numbers. If the divisor is 0 a ''Division by zero'' error is shown but the script does not stop and the result of such division is assumed to be 0.<br><br>
|descr= Returns the quotient of two numbers. If the divisor is 0 a ''Division by zero'' error is shown but the script does not stop and the result of such division is assumed to be 0.<br><br>
Alternative syntax returns [[Config]] entry with given name (alias for [[config greater greater name|>>]], slightly slower but with [[SQF Syntax#Rules of Precedence | higher precedence]]).
Alternative syntax returns the [[Config]] entry with the given name (alias for [[config greater greater name|>>]], slightly slower but with [[Operators#Order of Precedence|higher precedence]]).


|s1= a [[a / b|/]] b
|s1= a [[a / b|/]] b

Latest revision as of 23:53, 29 April 2024

Hover & click on the images for description

Description

Description:
Returns the quotient of two numbers. If the divisor is 0 a Division by zero error is shown but the script does not stop and the result of such division is assumed to be 0.

Alternative syntax returns the Config entry with the given name (alias for >>, slightly slower but with higher precedence).
Groups:
MathConfig

Syntax

Syntax:
a / b
Parameters:
a: Number - dividend
b: Number - divisor
Return Value:
Number - quotient

Alternative Syntax

Syntax:
config / name
Parameters:
config: Config
name: String
Return Value:
Nothing

Examples

Example 1:
_result = 15 / 3; // result is 5
Example 2:
_cfgVehicles = configFile / "CfgVehicles"; // identical to configFile >> "CfgVehicles" (but the order of precedence)

Additional Information

See also:
Operators configFile missionConfigFile campaignConfigFile configName config >> name count

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note
ffur2007slx2_5 - c
Posted on Apr 01, 2014 - 00:02 (UTC)
(Arma 3 1.14) config / name can be composed to config >> name String or Array format via BIS_fnc_configPath. E.g.
[configFile / "ATMineCrater" / "MissileCircleDust", ""] call BIS_fnc_configPath; // return: "configfile >> "ATMineCrater" >> "MissileCircleDust"" [configFile / "ATMineCrater" / "MissileCircleDust", []] call BIS_fnc_configPath; // return: ["configfile","ATMineCrater","MissileCircleDust"]