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