#include extern "C" { #include } #include namespace Poincare { ArcCosine::ArcCosine() : Function("acos") { } Expression::Type ArcCosine::type() const { return Type::ArcCosine; } Expression * ArcCosine::cloneWithDifferentOperands(Expression** newOperands, int numberOfOperands, bool cloneOperands) const { assert(newOperands != nullptr); ArcCosine * c = new ArcCosine(); c->setArgument(newOperands, numberOfOperands, cloneOperands); return c; } template Complex ArcCosine::templatedComputeComplex(const Complex c, AngleUnit angleUnit) const { assert(angleUnit != AngleUnit::Default); if (c.b() != 0) { return Complex::Float(NAN); } T result = std::acos(c.a()); if (angleUnit == AngleUnit::Degree) { return Complex::Float(result*180/M_PI); } return Complex::Float(result); } }