Compute power for real on the simulator.

Change-Id: I790f0b1216584835cd551893f16c052d21de7e31
This commit is contained in:
Felix Raimundo
2016-03-18 11:11:40 +01:00
committed by Félix Raimundo
parent d1b14397ed
commit a4e3f1e2d1

View File

@@ -1,3 +1,7 @@
#if PLATFORM==simulator
#include <cmath>
#endif
#include <poincare/power.h>
#include "layout/exponent_layout.h"
@@ -12,8 +16,12 @@ Power::~Power() {
}
float Power::approximate(Context& context) {
// TODO: do this for real
return 1;
#if PLATFORM==simulator
return powf(m_base->approximate(context), m_exponent->approximate(context));
#else
// TODO(fraimundo): do this for real
return 1f;
#endif
}
ExpressionLayout * Power::createLayout(ExpressionLayout * parent) {