mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-18 21:30:38 +01:00
[poincare/derivative] Derivate special numbers
Derivate the numbers Undefined, Unreal, Infinity symbolically : Undefined -> Undefined Unreal -> Unreal Infinity -> Undefined
This commit is contained in:
committed by
EmilieNumworks
parent
76eb155ed5
commit
7ae03975cc
@@ -37,6 +37,11 @@ public:
|
||||
// Layout
|
||||
Layout createLayout(Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const override;
|
||||
int serialize(char * buffer, int bufferSize, Preferences::PrintFloatMode floatDisplayMode = Preferences::PrintFloatMode::Decimal, int numberOfSignificantDigits = 0) const override;
|
||||
|
||||
/* Derivation
|
||||
* Unlike Numbers that derivate to 0, Infinity derivates to Undefined. */
|
||||
bool derivate(ReductionContext reductionContext, Expression symbol, Expression symbolValue) override;
|
||||
|
||||
private:
|
||||
// Simplification
|
||||
LayoutShape leftLayoutShape() const override { assert(!m_negative); return LayoutShape::MoreLetters; }
|
||||
@@ -56,6 +61,7 @@ public:
|
||||
static int NameSize() {
|
||||
return 4;
|
||||
}
|
||||
bool derivate(ExpressionNode::ReductionContext reductionContext, Expression symbol, Expression symbolValue);
|
||||
private:
|
||||
InfinityNode * node() const { return static_cast<InfinityNode *>(Number::node()); }
|
||||
};
|
||||
|
||||
@@ -30,8 +30,8 @@ public:
|
||||
}
|
||||
|
||||
/* Derivation
|
||||
* Overrides NumberNode's derivate to revert to a non-derivable state */
|
||||
bool derivate(ReductionContext reductionContext, Expression symbol, Expression symbolValue) override { return false; }
|
||||
* Unlike Numbers that derivate to 0, Undefined derivates to Undefined. */
|
||||
bool derivate(ReductionContext reductionContext, Expression symbol, Expression symbolValue) override { return true; }
|
||||
|
||||
// Layout
|
||||
Layout createLayout(Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const override;
|
||||
|
||||
@@ -28,7 +28,7 @@ public:
|
||||
}
|
||||
|
||||
/* Derivation
|
||||
* Overrides NumberNode's derivate to revert to a non-derivable state */
|
||||
* Unlike Numbers that derivate to 0, Unreal derivates to Unreal. */
|
||||
bool derivate(ReductionContext reductionContext, Expression symbol, Expression symbolValue) override { return false; }
|
||||
|
||||
// Layout
|
||||
|
||||
Reference in New Issue
Block a user