32 bool Factorial::needParenthesisWithParent(
const Expression * e)
const {
38 Expression * Factorial::shallowReduce(Context& context, AngleUnit angleUnit) {
39 Expression * e = Expression::shallowReduce(context, angleUnit);
43 #if MATRIX_EXACT_REDUCING 45 return SimplificationEngine::map(
this, context, angleUnit);
53 if (Integer(k_maxOperandValue).isLowerThan(r->numerator())) {
69 Complex<T> Factorial::computeOnComplex(
const Complex<T>
c, AngleUnit angleUnit) {
71 if (
c.b() != 0 ||
std::isnan(n) || n != (int)n || n < 0) {
75 for (
int i = 1; i <= (int)n; i++) {
84 ExpressionLayout * Factorial::privateCreateLayout(
PrintFloat::Mode floatDisplayMode, ComplexFormat complexFormat)
const {
87 ExpressionLayout * childrenLayouts[2];
89 childrenLayouts[1] =
new StringLayout(
"!", 1);
90 return new HorizontalLayout(childrenLayouts, 2);
93 int Factorial::writeTextInBuffer(
char * buffer,
int bufferSize,
int numberOfSignificantDigits)
const {
94 if (bufferSize == 0) {
97 buffer[bufferSize-1] = 0;
99 if (numberOfChar >= bufferSize-1) {
102 buffer[numberOfChar++] =
'!';
103 buffer[numberOfChar] = 0;
108 int Factorial::simplificationOrderGreaterType(
const Expression * e)
const {
Factorial(const Expression *argument, bool clone=true)
Expression * replaceWith(Expression *newOperand, bool deleteAfterReplace=true)
int simplificationOrderSameType(const Expression *e, bool canBeInterrupted) const override
static Integer Factorial(const Integer &i)
Expression * editableOperand(int i)
static int SimplificationOrder(const Expression *e1, const Expression *e2, bool canBeInterrupted=false)
const Expression * m_operands[T]
ExpressionLayout * createLayout(PrintFloat::Mode floatDisplayMode=PrintFloat::Mode::Default, ComplexFormat complexFormat=ComplexFormat::Default) const
static Complex< T > Float(T x)
Expression * clone() const override
Type type() const override
const Expression * operand(int i) const
virtual Type type() const =0
virtual int writeTextInBuffer(char *buffer, int bufferSize, int numberOfSignificantDigits=PrintFloat::k_numberOfStoredSignificantDigits) const =0