#include extern "C" { #include #include } #include #include "layout/horizontal_layout.h" #include "layout/parenthesis_layout.h" #include "layout/string_layout.h" namespace Poincare { NaperianLogarithm::NaperianLogarithm() : Function("ln") { } Expression::Type NaperianLogarithm::type() const { return Type::NaperianLogarithm; } Expression * NaperianLogarithm::cloneWithDifferentOperands(Expression** newOperands, int numberOfOperands, bool cloneOperands) const { assert(newOperands != nullptr); NaperianLogarithm * l = new NaperianLogarithm(); l->setArgument(newOperands, numberOfOperands, cloneOperands); return l; } template Complex NaperianLogarithm::templatedComputeComplex(const Complex c) const { if (c.b() != 0) { return Complex::Float(NAN); } return Complex::Float(std::log(c.a())); } }