Numworks Epsilon  1.4.1
Graphing Calculator Operating System
binomial_coefficient.h
Go to the documentation of this file.
1 #ifndef POINCARE_BINOMIAL_COEFFICIENT_H
2 #define POINCARE_BINOMIAL_COEFFICIENT_H
3 
6 
7 namespace Poincare {
8 
11 public:
12  Type type() const override;
13  Expression * clone() const override;
14  template<typename T> static T compute(T k, T n);
15 private:
16  constexpr static int k_maxNValue = 300;
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, "binomial");
21  }
22  /* Simplification */
23  Expression * shallowReduce(Context& context, AngleUnit angleUnit) override;
24  /* Evaluation */
25  Expression * privateApproximate(SinglePrecision p, Context& context, AngleUnit angleUnit) const override { return templatedApproximate<float>(context, angleUnit); }
26  Expression * privateApproximate(DoublePrecision p, Context& context, AngleUnit angleUnit) const override { return templatedApproximate<double>(context, angleUnit); }
27  template<typename T> Expression * templatedApproximate(Context& context, AngleUnit angleUnit) const;
28 };
29 
30 }
31 
32 #endif
33 
#define T(x)
Definition: events.cpp:26
Expression * clone() const override
static int writePrefixExpressionTextInBuffer(const Expression *expression, char *buffer, int bufferSize, int numberOfDigits, const char *operatorName)