Jump to content

ProbabilityCalculator

From CMM Wiki
Revision as of 10:12, 11 November 2025 by Ozdeadmeat (talk | contribs) (ProbabilityCalculator – created via PowerShell script (2025-11-11T21:12:27Z))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Return to CMM Command Reference
Environment: Mission Scripting
Function: ProbabilityCalculator
Function Description: Calculates the probability of two numbers out of a total sum, returning either a single probability or a table of two probabilities based on a boolean flag.
File Location: cmm.mathsFunctions.lua
Syntax: CMM.ProbabilityCalculator( number num1 , number num2 , boolean GiveBothBool )
Return Value: any
Parameters: Name Description
num1First number used in the probability calculation, representing one part of the total.
num2Second number used in the probability calculation, representing the other part of the total.
GiveBothBoolIf true, returns a table with both probabilities; if false or omitted, returns only the first probability (defaults to false).
Example: CMM.ProbabilityCalculator(10, 20, true)
Example Description: Returns a table {0.333, 0.667} representing the probabilities of 10 and 20 out of a total of 30.
Related Functions:
Notes: