This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Calculates a value using the rule of three principle. | |
* The logic is: "If 'baseCondition' results in 'baseResult', then 'targetCondition' will result in...?" | |
* Formula: (baseResult * targetCondition) / baseCondition | |
* | |
* @param baseCondition The base value for the proportion (A). | |
* @param baseResult The result corresponding to the base value (B). | |
* @param targetCondition The value for which to find the proportional result (C). | |
* @returns The calculated result (X), or null if any input is not a number or if division by zero occurs. | |
*/ |