Blame view

Giac_maj/epsilon-giac/poincare/src/imaginary_part.cpp 716 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
  #include <poincare/imaginary_part.h>
  #include <poincare/complex.h>
  #include <cmath>
  extern "C" {
  #include <assert.h>
  }
  
  namespace Poincare {
  
  ImaginaryPart::ImaginaryPart() :
    Function("im")
  {
  }
  
  Expression::Type ImaginaryPart::type() const {
    return Type::ImaginaryPart;
  }
  
  Expression * ImaginaryPart::cloneWithDifferentOperands(Expression** newOperands,
          int numberOfOperands, bool cloneOperands) const {
    assert(newOperands != nullptr);
    ImaginaryPart * ip = new ImaginaryPart();
    ip->setArgument(newOperands, numberOfOperands, cloneOperands);
    return ip;
  }
  
  template<typename T>
  Complex<T> ImaginaryPart::templatedComputeComplex(const Complex<T> c) const {
    return Complex<T>::Float(c.b());
  }
  
  }