Numworks Epsilon  1.4.1
Graphing Calculator Operating System
logarithm.h
Go to the documentation of this file.
1 #ifndef POINCARE_LOGARITHM_H
2 #define POINCARE_LOGARITHM_H
3 
6 #include <poincare/integer.h>
7 
8 namespace Poincare {
9 
10 class Logarithm : public BoundedStaticHierarchy<2> {
12  friend class NaperianLogarithm;
13 public:
14  Type type() const override;
15  Expression * clone() const override;
16 private:
17  /* Layout */
18  ExpressionLayout * privateCreateLayout(PrintFloat::Mode floatDisplayMode, ComplexFormat complexFormat) const override;
19  int writeTextInBuffer(char * buffer, int bufferSize, int numberOfSignificantDigits = PrintFloat::k_numberOfStoredSignificantDigits) const override {
20  return LayoutEngine::writePrefixExpressionTextInBuffer(this, buffer, bufferSize, numberOfSignificantDigits, "log");
21  }
22  /* Simplification */
23  Expression * shallowReduce(Context & context, AngleUnit angleUnit) override;
24  Expression * simpleShallowReduce(Context & context, AngleUnit angleUnit);
25  Expression * shallowBeautify(Context & context, AngleUnit angleUnit) override;
26  bool parentIsAPowerOfSameBase() const;
27  Expression * splitInteger(Integer i, bool isDenominator, Context & context, AngleUnit angleUnit);
28  /* Evaluation */
29  template<typename T> static Complex<T> computeOnComplex(const Complex<T> c, AngleUnit angleUnit);
30  Expression * privateApproximate(SinglePrecision p, Context& context, AngleUnit angleUnit) const override { return templatedApproximate<float>(context, angleUnit); }
31  Expression * privateApproximate(DoublePrecision p, Context& context, AngleUnit angleUnit) const override { return templatedApproximate<double>(context, angleUnit); }
32  template<typename T> Expression * templatedApproximate(Context& context, AngleUnit angleUnit) const;
33 };
34 
35 }
36 
37 #endif
Type type() const override
Definition: logarithm.cpp:26
c(generic_all_nodes)
Expression * clone() const override
Definition: logarithm.cpp:30
static int writePrefixExpressionTextInBuffer(const Expression *expression, char *buffer, int bufferSize, int numberOfDigits, const char *operatorName)