21 unsigned char tag =
'O';
22 char * taggedBuffer =
new char[bufferSize+2*tagSize];
23 memset(taggedBuffer, tag, bufferSize+2*tagSize);
24 char * buffer = taggedBuffer + tagSize;
26 PrintFloat::convertFloatToText<T>(a, buffer, bufferSize, significantDigits, mode);
28 for (
int i=0; i<tagSize; i++) {
29 assert(taggedBuffer[i] == tag);
31 for (
int i=tagSize+
strlen(buffer)+1; i<bufferSize+2*tagSize; i++) {
32 assert(taggedBuffer[i] == tag);
38 delete[] taggedBuffer;
45 unsigned char tag =
'O';
46 char * taggedBuffer =
new char[bufferSize+2*tagSize];
47 memset(taggedBuffer, tag, bufferSize+2*tagSize);
48 char * buffer = taggedBuffer + tagSize;
55 for (
int i=0; i<tagSize; i++) {
56 assert(taggedBuffer[i] == tag || taggedBuffer[i] == 0);
58 for (
int i=tagSize+
strlen(buffer)+1; i<bufferSize+2*tagSize; i++) {
59 assert(taggedBuffer[i] == tag || taggedBuffer[i] == 0);
64 delete[] taggedBuffer;
105 Rational r1(
"12345678910111213",
"123456789101112131");
107 Rational r2(
"123456789112345678921234567893123456789412345678951234567896123456789612345678971234567898123456789912345678901234567891123456789212345678931234567894123456789512345678961234567896123456789712345678981234567899123456789",
"1");
108 assert_expression_prints_to(&r2,
"123456789112345678921234567893123456789412345678951234567896123456789612345678971234567898123456789912345678901234567891123456789212345678931234567894123456789512345678961234567896123456789712345678981234567899123456789");
159 Decimal e12(0.9999999999999995);
161 Decimal e13(0.999999999999995);
163 Decimal e14(0.000000999999999999995);
165 Decimal e15(0.0000009999999999999995);
167 Decimal e16(0.0000009999999999901200121020102010201201201021099995);
void translate_in_ASCII_chars(char *expression)
static Preferences * sharedPreferences()
void * memset(void *b, int c, size_t len)
static Complex< T > Cartesian(T a, T b)
QUIZ_CASE(assert_float_prints_to)
void assert_float_prints_to(T a, const char *result, PrintFloat::Mode mode=ScientificDisplay, int significantDigits=7, int bufferSize=250)
constexpr PrintFloat::Mode ScientificDisplay
constexpr Expression::ComplexFormat Cartesian
void setComplexFormat(Expression::ComplexFormat complexFormat)
size_t strlen(const char *s)
constexpr PrintFloat::Mode DecimalDisplay
void assert_expression_prints_to(Expression *e, const char *result, PrintFloat::Mode mode=ScientificDisplay, Expression::ComplexFormat format=Cartesian, int bufferSize=250)
void quiz_print(const char *message)
int strcmp(const char *s1, const char *s2)
constexpr Expression::ComplexFormat Polar
void setDisplayMode(PrintFloat::Mode mode)
virtual int writeTextInBuffer(char *buffer, int bufferSize, int numberOfSignificantDigits=PrintFloat::k_numberOfStoredSignificantDigits) const =0