[apps/probability] For discrete law, round calculation parameters to the

closest integer

Change-Id: I53dcc0605ae91ed27257fa4b831ce8a2287db3ef
This commit is contained in:
Émilie Feral
2017-04-17 14:41:26 +02:00
parent 8f2a6c3122
commit 5ad85c59c2

View File

@@ -227,6 +227,9 @@ bool CalculationController::textFieldDidFinishEditing(TextField * textField, con
floatBody = 1.0f;
}
}
if (!m_law->isContinuous() && (m_highlightedSubviewIndex == 1 || m_calculation->type() == Calculation::Type::FiniteIntegral)) {
floatBody = roundf(floatBody);
}
m_calculation->setParameterAtIndex(floatBody, m_highlightedSubviewIndex-1);
for (int k = 0; k < m_calculation->numberOfParameters(); k++) {
m_contentView.willDisplayEditableCellAtIndex(k);