#include #include namespace Poincare { template Expression FloatNode::setSign(Sign s, Context & context, Preferences::AngleUnit angleUnit) { Expression thisExpr = Number(this); Expression result = Float(-m_value); thisExpr.replaceWithInPlace(result); return result; } template int FloatNode::simplificationOrderSameType(const ExpressionNode * e, bool canBeInterrupted) const { assert(e->type() == ExpressionNode::Type::Float); const FloatNode * other = static_cast *>(e); if (value() < other->value()) { return -1; } if (value() > other->value()) { return 1; } return 0; } template int FloatNode::serialize(char * buffer, int bufferSize, Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const { return PrintFloat::convertFloatToText(m_value, buffer, bufferSize, numberOfSignificantDigits, floatDisplayMode); } template Layout FloatNode::createLayout(Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const { char buffer[PrintFloat::k_maxFloatBufferLength]; int numberOfChars = serialize(buffer, PrintFloat::k_maxFloatBufferLength, floatDisplayMode, numberOfSignificantDigits); return LayoutHelper::String(buffer, numberOfChars); } template Float::Float(T value) : Number(TreePool::sharedPool()->createTreeNode>()) { node()->setFloat(value); } template class FloatNode; template class FloatNode; template Float::Float(float value); template Float::Float(double value); }