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