mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-26 09:10:48 +01:00
[poincare] Fix Sine and Cosine
This commit is contained in:
@@ -3,7 +3,6 @@
|
||||
|
||||
#include <poincare/approximation_helper.h>
|
||||
#include <poincare/expression.h>
|
||||
#include <poincare/layout_helper.h>
|
||||
#include <poincare/serialization_helper.h>
|
||||
#include <poincare/trigonometry.h>
|
||||
|
||||
@@ -33,9 +32,7 @@ public:
|
||||
|
||||
private:
|
||||
// Layout
|
||||
LayoutReference createLayout(Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const override {
|
||||
return LayoutHelper::Prefix(this, floatDisplayMode, numberOfSignificantDigits, name());
|
||||
}
|
||||
LayoutReference createLayout(Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const override;
|
||||
int serialize(char * buffer, int bufferSize, Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const override {
|
||||
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, name());
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
|
||||
#include <poincare/approximation_helper.h>
|
||||
#include <poincare/expression.h>
|
||||
#include <poincare/layout_helper.h>
|
||||
#include <poincare/serialization_helper.h>
|
||||
#include <poincare/trigonometry.h>
|
||||
|
||||
@@ -33,9 +32,7 @@ public:
|
||||
|
||||
private:
|
||||
// Layout
|
||||
LayoutReference createLayout(Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const override {
|
||||
return LayoutHelper::Prefix(this, floatDisplayMode, numberOfSignificantDigits, name());
|
||||
}
|
||||
LayoutReference createLayout(Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const override;
|
||||
int serialize(char * buffer, int bufferSize, Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const override {
|
||||
return SerializationHelper::Prefix(this, buffer, bufferSize, floatDisplayMode, numberOfSignificantDigits, name());
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include <poincare/cosine.h>
|
||||
#include <poincare/complex.h>
|
||||
#include <poincare/layout_helper.h>
|
||||
#include <poincare/simplification_helper.h>
|
||||
#include <cmath>
|
||||
|
||||
@@ -22,6 +23,10 @@ Complex<T> CosineNode::computeOnComplex(const std::complex<T> c, Preferences::An
|
||||
return Complex<T>(Trigonometry::RoundToMeaningfulDigits(res));
|
||||
}
|
||||
|
||||
LayoutReference CosineNode::createLayout(Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const {
|
||||
return LayoutHelper::Prefix(Cosine(this), floatDisplayMode, numberOfSignificantDigits, name());
|
||||
}
|
||||
|
||||
Expression CosineNode::shallowReduce(Context& context, Preferences::AngleUnit angleUnit) const {
|
||||
return Cosine(this).shallowReduce(context, angleUnit);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include <poincare/sine.h>
|
||||
#include <poincare/complex.h>
|
||||
#include <poincare/layout_helper.h>
|
||||
#include <poincare/simplification_helper.h>
|
||||
#include <cmath>
|
||||
|
||||
@@ -22,6 +23,10 @@ Complex<T> SineNode::computeOnComplex(const std::complex<T> c, Preferences::Angl
|
||||
return Complex<T>(Trigonometry::RoundToMeaningfulDigits(res));
|
||||
}
|
||||
|
||||
LayoutReference SineNode::createLayout(Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const {
|
||||
return LayoutHelper::Prefix(Sine(this), floatDisplayMode, numberOfSignificantDigits, name());
|
||||
}
|
||||
|
||||
Expression SineNode::shallowReduce(Context& context, Preferences::AngleUnit angleUnit) const {
|
||||
return Sine(this).shallowReduce(context, angleUnit);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user