mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-27 09:40:07 +01:00
40 lines
1.1 KiB
C++
40 lines
1.1 KiB
C++
#include <poincare/undefined.h>
|
|
#include <poincare/complex.h>
|
|
#include <poincare/layout_helper.h>
|
|
|
|
extern "C" {
|
|
#include <math.h>
|
|
#include <string.h>
|
|
}
|
|
|
|
namespace Poincare {
|
|
|
|
UndefinedNode * UndefinedNode::FailedAllocationStaticNode() {
|
|
static AllocationFailureExpressionNode<UndefinedNode> failure;
|
|
return &failure;
|
|
}
|
|
|
|
int UndefinedNode::polynomialDegree(char symbolName) const {
|
|
return -1;
|
|
}
|
|
|
|
LayoutRef UndefinedNode::createLayout(Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const {
|
|
char buffer[6];
|
|
int numberOfChars = PrintFloat::convertFloatToText<float>(NAN, buffer, 6, numberOfSignificantDigits, floatDisplayMode);
|
|
return LayoutHelper::String(buffer, numberOfChars);
|
|
}
|
|
|
|
int UndefinedNode::writeTextInBuffer(char * buffer, int bufferSize, Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const {
|
|
if (bufferSize == 0) {
|
|
return -1;
|
|
}
|
|
return PrintFloat::convertFloatToText<float>(NAN, buffer, bufferSize, numberOfSignificantDigits, floatDisplayMode);
|
|
}
|
|
|
|
template<typename T> Evaluation<T> UndefinedNode::templatedApproximate() const {
|
|
return Complex<T>::Undefined();
|
|
}
|
|
|
|
}
|
|
|