#include #include "layout/floor_layout.h" extern "C" { #include } #include namespace Poincare { Floor::Floor() : Function("floor") { } Expression::Type Floor::type() const { return Type::Floor; } Expression * Floor::cloneWithDifferentOperands(Expression** newOperands, int numberOfOperands, bool cloneOperands) const { assert(newOperands != nullptr); Floor * f = new Floor(); f->setArgument(newOperands, numberOfOperands, cloneOperands); return f; } template Complex Floor::templatedComputeComplex(const Complex c) const { if (c.b() != 0) { return Complex::Float(NAN); } return Complex::Float(std::floor(c.a())); } ExpressionLayout * Floor::privateCreateLayout(FloatDisplayMode floatDisplayMode, ComplexFormat complexFormat) const { assert(floatDisplayMode != FloatDisplayMode::Default); assert(complexFormat != ComplexFormat::Default); return new FloorLayout(m_args[0]->createLayout(floatDisplayMode, complexFormat)); } }