[poincare] Expand numbers to complex numbers

Change-Id: I2e7cf5240e184da45b656ee4f121ad76aabfd1c7
This commit is contained in:
Émilie Feral
2017-02-02 17:37:01 +01:00
parent 131b364ae9
commit 676bd46f33
66 changed files with 602 additions and 392 deletions

View File

@@ -167,7 +167,7 @@ void ValuesController::willDisplayCellAtLocation(TableViewCell * cell, int i, in
return;
}
// The cell is not a title cell
char buffer[Float::bufferSizeForFloatsWithPrecision(Constant::LargeNumberOfSignificantDigits)];
char buffer[Complex::bufferSizeForFloatsWithPrecision(Constant::LargeNumberOfSignificantDigits)];
// Special case: last row
if (j == numberOfRows() - 1) {
int numberOfIntervalElements = m_interval.numberOfElements();
@@ -184,9 +184,9 @@ void ValuesController::willDisplayCellAtLocation(TableViewCell * cell, int i, in
App * graphApp = (Graph::App *)app();
float x = m_interval.element(j-1);
if (isDerivativeColumn(i)) {
Float(function->approximateDerivative(x, graphApp->localContext(), myContainer->preferences()->angleUnit())).convertFloatToText(buffer, Float::bufferSizeForFloatsWithPrecision(Constant::LargeNumberOfSignificantDigits), Constant::LargeNumberOfSignificantDigits, myContainer->preferences()->displayMode());
Complex::convertFloatToText(function->approximateDerivative(x, graphApp->localContext(), myContainer->preferences()->angleUnit()), buffer, Complex::bufferSizeForFloatsWithPrecision(Constant::LargeNumberOfSignificantDigits), Constant::LargeNumberOfSignificantDigits, myContainer->preferences()->displayMode());
} else {
Float(function->evaluateAtAbscissa(x, graphApp->localContext(), myContainer->preferences()->angleUnit())).convertFloatToText(buffer, Float::bufferSizeForFloatsWithPrecision(Constant::LargeNumberOfSignificantDigits), Constant::LargeNumberOfSignificantDigits, myContainer->preferences()->displayMode());
Complex::convertFloatToText(function->evaluateAtAbscissa(x, graphApp->localContext(), myContainer->preferences()->angleUnit()), buffer, Complex::bufferSizeForFloatsWithPrecision(Constant::LargeNumberOfSignificantDigits), Constant::LargeNumberOfSignificantDigits, myContainer->preferences()->displayMode());
}
myValueCell->setText(buffer);
}