Blame view

Giac_maj/epsilon-giac/poincare/src/hyperbolic_arc_cosine.cpp 810 Bytes
6663b6c9   adorian   projet complet av...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
  #include <poincare/hyperbolic_arc_cosine.h>
  extern "C" {
  #include <assert.h>
  }
  #include <cmath>
  
  namespace Poincare {
  
  HyperbolicArcCosine::HyperbolicArcCosine() :
    Function("acosh")
  {
  }
  
  Expression::Type HyperbolicArcCosine::type() const {
    return Type::HyperbolicArcCosine;
  }
  
  Expression * HyperbolicArcCosine::cloneWithDifferentOperands(Expression** newOperands,
          int numberOfOperands, bool cloneOperands) const {
    assert(newOperands != nullptr);
    HyperbolicArcCosine * c = new HyperbolicArcCosine();
    c->setArgument(newOperands, numberOfOperands, cloneOperands);
    return c;
  }
  
  template<typename T>
  Complex<T> HyperbolicArcCosine::templatedComputeComplex(const Complex<T> c) const {
    if (c.b() != 0) {
      return Complex<T>::Float(NAN);
    }
    return Complex<T>::Float(std::acosh(c.a()));
  }
  
  }