private float CalcFatPercent(Gender gender, float waist, float hips, float neck, float height, float weight, bool hardMode) { float fatPercent = KbguCalculation.FatPercent(height, weight, gender); if (hardMode) { fatPercent = KbguCalculation.FatPercentHardMode(height, gender, waist, hips, neck); } return(fatPercent); }
private (float, float) CalcFatPercent(float height, float weight, Gender gender, float waist, float hips, float neck, bool hardMode) { float fatPercentDifference = 0; float fatPercent; if (hardMode) { var hard = KbguCalculation.FatPercentHardMode(height, gender, waist, hips, neck); var simple = KbguCalculation.FatPercent(height, weight, gender); fatPercent = hard; // Расчет разницы между простым и детальным расчетом fatPercentDifference = simple > hard ? -Math.Abs(simple - hard) : Math.Abs(simple - hard); } else { fatPercent = KbguCalculation.FatPercent(height, weight, gender); } return(fatPercent, fatPercentDifference); }