[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    Re: [analitza/imaginary] analitza: Fix some issues for complex numbers
From:       Percy_Camilo_Triveño_Aucahuasi <percy.camilo.ta () gmail ! com>
Date:       2014-06-15 23:07:10
Message-ID: 8363D5AA-C281-4EDF-B248-AA405A1DD787 () gmail ! com
[Download RAW message or body]

Sorry for that, was late, next time I'll wait and think better about commit messages. \


Details are:
- Fix print style of complex numbers.
- Change to double as base type for complex, rationale: more precision and keep \
consistence with semantic of Cn::value (which already has double as type)

Percy

On Jun 15, 2014, at 4:11 PM, Aleix Pol <aleixpol@kde.org> wrote:

> La descripción de este commit es de lejos incompleta. De hecho lo deberías haber \
> hecho por lo menos en 3 commits que cada uno cambie una cosa distinta. Aparte \
> cambia de float a double el imaginaryPart sin ninguna razón aparente? 
> Aleix
> 
> 
> On Sun, Jun 15, 2014 at 5:25 AM, Percy Camilo Triveño Aucahuasi \
> <percy.camilo.ta@gmail.com> wrote: Git commit \
> 33bac90b347ce5424117e09b24a6d2a4de9dcdf9 by Percy Camilo Triveño Aucahuasi. \
> Committed on 15/06/2014 at 03:25. Pushed by aucahuasi into branch 'imaginary'.
> 
> Fix some issues for complex numbers
> 
> M  +31   -2    analitza/htmlexpressionwriter.cpp
> M  +1    -0    analitza/htmlexpressionwriter.h
> M  +7    -7    analitza/operations.cpp
> M  +24   -2    analitza/stringexpressionwriter.cpp
> M  +1    -0    analitza/stringexpressionwriter.h
> M  +14   -1    analitza/tests/analitzatest.cpp
> M  +3    -3    analitza/value.cpp
> M  +7    -7    analitza/value.h
> 
> http://commits.kde.org/analitza/33bac90b347ce5424117e09b24a6d2a4de9dcdf9
> 
> diff --git a/analitza/htmlexpressionwriter.cpp b/analitza/htmlexpressionwriter.cpp
> index 87db178..ab5a21a 100644
> --- a/analitza/htmlexpressionwriter.cpp
> +++ b/analitza/htmlexpressionwriter.cpp
> @@ -32,6 +32,8 @@
> 
> using namespace Analitza;
> 
> +const double HtmlExpressionWriter::MIN_PRINTABLE_VALUE = 0.0000000000001; // since \
> the precision we choose for 'G' is 12 +
> //we use the one in string*
> QMap<Operator::OperatorType, QString> initOperators();
> 
> @@ -83,10 +85,37 @@ QVariant HtmlExpressionWriter::visit(const List* vec)
> 
> QVariant HtmlExpressionWriter::visit(const Cn* var)
> {
> +       QString innerhtml;
> if(var->isBoolean())
> -               return QString("<span class='var'>"+QString(var->isTrue() ? "true" \
> : "false")+"</span>"); +               innerhtml = var->isTrue() ? "true" : \
> "false"; +       else if(var->isCharacter())
> +               innerhtml = QString(var->character());
> +       else if(var->isComplex()) {
> +               QString realpart;
> +               QString imagpart;
> +               bool realiszero = false;
> +               if (qAbs(var->complexValue().real()) > MIN_PRINTABLE_VALUE)
> +                       realpart = QString::number(var->complexValue().real(), 'g', \
> 12); +               else
> +                       realiszero = true;
> +
> +               if (var->complexValue().imag() != 1) {
> +                       if (qAbs(var->complexValue().imag()) > MIN_PRINTABLE_VALUE) \
> { +                               if (!realiszero && var->complexValue().imag()>0.)
> +                                       realpart += QLatin1String("+");
> +                               imagpart = \
> QString::number(var->complexValue().imag(), 'g', 12); +                             \
> imagpart += QLatin1String("*i"); +                       }
> +               } else  {
> +                       imagpart = QLatin1String("i");
> +               }
> +
> +               innerhtml = realpart+imagpart;
> +       }
> else
> -               return QString("<span class='num'>"+QString::number(var->value(), \
> 'g', 12)+"</span>"); +               innerhtml = QString::number(var->value(), 'g', \
> 12); +
> +       return QString("<span class='num'>"+innerhtml+"</span>");
> }
> 
> QVariant HtmlExpressionWriter::visit(const Analitza::Ci* var)
> diff --git a/analitza/htmlexpressionwriter.h b/analitza/htmlexpressionwriter.h
> index 0b2660c..0456a21 100644
> --- a/analitza/htmlexpressionwriter.h
> +++ b/analitza/htmlexpressionwriter.h
> @@ -54,6 +54,7 @@ class HtmlExpressionWriter : public AbstractExpressionVisitor
> template <class T>
> static QStringList allValues(T it, const T& itEnd, AbstractExpressionVisitor* \
> writer); QVariant m_result;
> +               static const double MIN_PRINTABLE_VALUE;
> };
> 
> }
> diff --git a/analitza/operations.cpp b/analitza/operations.cpp
> index cdd0027..f14e463 100644
> --- a/analitza/operations.cpp
> +++ b/analitza/operations.cpp
> @@ -151,19 +151,19 @@ Cn* reduceRealReal(enum Operator::OperatorType op, Cn *oper, \
> double a, double b, return oper;
> }
> 
> -static bool operator<(complex<float> a, complex<float> b)
> +static bool operator<(complex<double> a, complex<double> b)
> { return a.real() < b.real() || (a.real() == b.real() && a.imag()<b.imag()); }
> 
> -static bool operator>(complex<float> a, complex<float> b)
> +static bool operator>(complex<double> a, complex<double> b)
> { return a.real() > b.real() || (a.real() == b.real() && a.imag()>b.imag()); }
> 
> -static bool operator<=(complex<float> a, complex<float> b)
> +static bool operator<=(complex<double> a, complex<double> b)
> { return a.real() <= b.real() || (a.real() == b.real() && a.imag()<=b.imag()); }
> 
> -static bool operator>=(complex<float> a, complex<float> b)
> +static bool operator>=(complex<double> a, complex<double> b)
> { return a.real() >= b.real() || (a.real() == b.real() && a.imag()>=b.imag()); }
> 
> -Cn* reduceComplexComplex(enum Operator::OperatorType op, Cn *oper, complex<float> \
> a, complex<float> b, QString** correct) +Cn* reduceComplexComplex(enum \
> Operator::OperatorType op, Cn *oper, complex<double> a, complex<double> b, \
> QString** correct) {
> switch(op) {
> case Operator::plus:
> @@ -274,7 +274,7 @@ Cn* reduceComplexComplex(enum Operator::OperatorType op, Cn \
> *oper, complex<float Cn* Operations::reduceValueValue(enum Operator::OperatorType \
> op, Cn *oper, const Cn *oper1, QString** correct) {
> if(KDE_ISUNLIKELY(oper->isComplex() || oper1->isComplex())) {
> -               const complex<float> a=oper->complexValue(), \
> b=oper1->complexValue(); +               const complex<double> \
> a=oper->complexValue(), b=oper1->complexValue(); return reduceComplexComplex(op, \
> oper, a, b, correct); } else {
> const double a=oper->value(), b=oper1->value();
> @@ -292,7 +292,7 @@ Cn* Operations::reduceUnaryValue(Operator::OperatorType op, Cn* \
> oper, QString** 
> Cn* Operations::reduceUnaryComplex(Operator::OperatorType op, Cn* val, QString** \
> correct) {
> -       const complex<float> a=val->complexValue();
> +       const complex<double> a=val->complexValue();
> 
> switch(op) {
> case Operator::minus:
> diff --git a/analitza/stringexpressionwriter.cpp \
> b/analitza/stringexpressionwriter.cpp index 4f434aa..50012b3 100644
> --- a/analitza/stringexpressionwriter.cpp
> +++ b/analitza/stringexpressionwriter.cpp
> @@ -30,6 +30,8 @@
> 
> using namespace Analitza;
> 
> +const double StringExpressionWriter::MIN_PRINTABLE_VALUE = 0.0000000000001; // \
> since the precision we choose for 'G' is 12 +
> template <class T>
> QStringList StringExpressionWriter::allValues(T it, const T& itEnd, \
> AbstractExpressionVisitor* writer) {
> @@ -105,8 +107,28 @@ QVariant StringExpressionWriter::visit(const Cn* var)
> return var->isTrue() ? "true" : "false";
> else if(var->isCharacter())
> return QString(var->character());
> -       else if(var->isComplex())
> -               return \
> QVariant::fromValue<QString>(QString::number(var->complexValue().real(), 'g', 12) + \
> QLatin1String("+i*") + QString::number(var->complexValue().imag(), 'g', 12)); +     \
> else if(var->isComplex()) { +               QString realpart;
> +               QString imagpart;
> +               bool realiszero = false;
> +               if (qAbs(var->complexValue().real()) > MIN_PRINTABLE_VALUE)
> +                       realpart = QString::number(var->complexValue().real(), 'g', \
> 12); +               else
> +                       realiszero = true;
> +
> +               if (var->complexValue().imag() != 1) {
> +                       if (qAbs(var->complexValue().imag()) > MIN_PRINTABLE_VALUE) \
> { +                               if (!realiszero && var->complexValue().imag()>0.)
> +                                       realpart += QLatin1String("+");
> +                               imagpart = \
> QString::number(var->complexValue().imag(), 'g', 12); +                             \
> imagpart += QLatin1String("*i"); +                       }
> +               } else  {
> +                       imagpart = QLatin1String("i");
> +               }
> +
> +               return QVariant::fromValue<QString>(realpart+imagpart);
> +       }
> else
> return QString::number(var->value(), 'g', 12);
> }
> diff --git a/analitza/stringexpressionwriter.h b/analitza/stringexpressionwriter.h
> index 523de30..6f9fb98 100644
> --- a/analitza/stringexpressionwriter.h
> +++ b/analitza/stringexpressionwriter.h
> @@ -58,6 +58,7 @@ class StringExpressionWriter : public AbstractExpressionVisitor
> static QStringList allValues(T it, const T& itEnd, AbstractExpressionVisitor* \
> writer); 
> QVariant m_result;
> +               static const double MIN_PRINTABLE_VALUE;
> };
> 
> }
> diff --git a/analitza/tests/analitzatest.cpp b/analitza/tests/analitzatest.cpp
> index 47d3c84..fcec6e8 100644
> --- a/analitza/tests/analitzatest.cpp
> +++ b/analitza/tests/analitzatest.cpp
> @@ -115,6 +115,7 @@ void AnalitzaTest::testTrivialCalculate_data()
> QTest::newRow("cpx1") << "i" << Cn(0, 1);
> QTest::newRow("cpx2") << "i*i" << Cn(-1);
> QTest::newRow("cpx3") << "2+i*i" << Cn(1);
> +       QTest::newRow("complex number") << "3+4*(5-6*i)" << Cn(23, -24);
> }
> 
> void AnalitzaTest::testTrivialCalculate()
> @@ -142,8 +143,14 @@ void AnalitzaTest::testTrivialEvaluate_data()
> {
> QTest::addColumn<QString>("expression");
> QTest::addColumn<QString>("result");
> -
> +
> QTest::newRow("simple value") << "2" << "2";
> +       QTest::newRow("simple complex value") << "6*(2+i)" << "12+6*i";
> +       QTest::newRow("complex irreductibility") << "i" << "i";
> +       QTest::newRow("from complex value") << "i*i" << "-1";
> +       QTest::newRow("from power complex") << "power(i, 2)" << "-1";
> +       QTest::newRow("sin complex") << "sin(i)" << "1.17520119364*i";
> +       QTest::newRow("cos complex") << "cos(5-9*i)" << \
> "1149.26926545-3885.12187972*i"; QTest::newRow("simple addition") << "2+2" << "4";
> QTest::newRow("simple addition with var") << "2+x" << "x+2";
> QTest::newRow("minus irreductibility") << "-x" << "-x";
> @@ -314,6 +321,12 @@ void AnalitzaTest::testCorrection_data()
> QTest::addColumn<QString>("result");
> 
> QStringList script;
> +
> +       script.clear();
> +       script << "f:=y->y*y";
> +       script << "f(i)";
> +       QTest::newRow("from complex function") << script << "-1";
> +
> script.clear();
> script << "n:=2";
> script << "n+1";
> diff --git a/analitza/value.cpp b/analitza/value.cpp
> index 8f567f1..fe0b8f3 100644
> --- a/analitza/value.cpp
> +++ b/analitza/value.cpp
> @@ -116,12 +116,12 @@ void Cn::setValue(bool v)
> m_imaginaryPart = 0;
> }
> 
> -std::complex<float> Cn::complexValue() const
> +std::complex<double> Cn::complexValue() const
> {
> -       return std::complex<float>(m_value, m_imaginaryPart);
> +       return std::complex<double>(m_value, m_imaginaryPart);
> }
> 
> -void Cn::setValue(std::complex<float> v)
> +void Cn::setValue(std::complex<double> v)
> {
> if(v.imag() == 0)
> setValue(v.real());
> diff --git a/analitza/value.h b/analitza/value.h
> index ab60dc0..176c825 100644
> --- a/analitza/value.h
> +++ b/analitza/value.h
> @@ -63,8 +63,8 @@ class ANALITZA_EXPORT Cn : public Object
> explicit Cn(const QChar& c) : Object(Object::value), m_char(c.unicode()), \
> m_imaginaryPart(0), m_format(Char) {} 
> /** Constructor. Creates a value that represents a complex. */
> -               explicit Cn(float value, float imaginaryPart) : \
> Object(Object::value), m_value(value), m_imaginaryPart(imaginaryPart), \
>                 m_format(Complex) {qDebug() << "xxxxxxxxxx" << toString();}
> -
> +               explicit Cn(double value, double imaginaryPart) : \
> Object(Object::value), m_value(value), m_imaginaryPart(imaginaryPart), \
> m_format(Complex) {} +
> /**
> *      Extracts the number from the @p e Dom element and saves it.
> */
> @@ -78,7 +78,7 @@ class ANALITZA_EXPORT Cn : public Object
> void setValue(int v);
> void setValue(uint v);
> void setValue(bool v);
> -               void setValue(std::complex<float> v);
> +               void setValue(std::complex<double> v);
> 
> /**
> *      Returns the value.
> @@ -149,16 +149,16 @@ class ANALITZA_EXPORT Cn : public Object
> QChar character() const { Q_ASSERT(m_format==Char); return QChar(m_char); }
> 
> /** @returns whether the value has an imaginary part */
> -               bool isComplex() const { return m_format == Complex; }
> +               bool isComplex() const { return m_format == Complex && \
> m_imaginaryPart!=0.; } 
> virtual QVariant accept(AbstractExpressionVisitor*) const;
> -               virtual bool isZero() const { return m_value==0. && \
> m_imaginaryPart==0.f; } +               virtual bool isZero() const { return \
> m_value==0. && m_imaginaryPart==0.; } 
> virtual bool matches(const Object* exp, QMap< QString, const Object* >* found) \
> const; /*/** Sets whether it is a correct Cn.
> void setCorrect(bool b) {m_correct = b; }*/
> 
> -               std::complex<float> complexValue() const;
> +               std::complex<double> complexValue() const;
> 
> virtual Object* copy() const;
> 
> @@ -167,7 +167,7 @@ class ANALITZA_EXPORT Cn : public Object
> static Cn euler();
> private:
> union { double m_value; ushort m_char; };
> -               float m_imaginaryPart;
> +               double m_imaginaryPart;
> enum ValueFormat m_format;
> };
> 
> 
> 


[Attachment #3 (unknown)]

<html><head></head><body bgcolor="#FFFFFF"><div><div><div>Sorry for that, was late, \
next time I'll wait and think better about commit \
messages.&nbsp;</div><div><br></div><div>Details are:</div><div>- Fix print style of \
complex numbers.</div><div>- Change to double as base type for complex, rationale: \
more precision and keep consistence with semantic of Cn::value (which already has \
double as type)</div><div><br></div><div>Percy</div><div><br>On Jun 15, 2014, at 4:11 \
PM, Aleix Pol &lt;<a href="mailto:aleixpol@kde.org">aleixpol@kde.org</a>&gt; \
wrote:<br><br></div><div></div><blockquote type="cite"><div><div dir="ltr">La \
descripción de este commit es de lejos incompleta. De hecho lo deberías haber hecho \
por lo menos en 3 commits que cada uno cambie una cosa distinta. Aparte cambia de \
float a double el imaginaryPart sin ninguna razón aparente?<div>

<br></div><div>Aleix</div></div><div class="gmail_extra"><br><br><div \
class="gmail_quote">On Sun, Jun 15, 2014 at 5:25 AM, Percy Camilo Triveño Aucahuasi \
<span dir="ltr">&lt;<a href="mailto:percy.camilo.ta@gmail.com" \
target="_blank">percy.camilo.ta@gmail.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex">Git commit 33bac90b347ce5424117e09b24a6d2a4de9dcdf9 by Percy \
Camilo Triveño Aucahuasi.<br> Committed on 15/06/2014 at 03:25.<br>
Pushed by aucahuasi into branch 'imaginary'.<br>
<br>
Fix some issues for complex numbers<br>
<br>
M &nbsp;+31 &nbsp; -2 &nbsp; &nbsp;analitza/htmlexpressionwriter.cpp<br>
M &nbsp;+1 &nbsp; &nbsp;-0 &nbsp; &nbsp;analitza/htmlexpressionwriter.h<br>
M &nbsp;+7 &nbsp; &nbsp;-7 &nbsp; &nbsp;analitza/operations.cpp<br>
M &nbsp;+24 &nbsp; -2 &nbsp; &nbsp;analitza/stringexpressionwriter.cpp<br>
M &nbsp;+1 &nbsp; &nbsp;-0 &nbsp; &nbsp;analitza/stringexpressionwriter.h<br>
M &nbsp;+14 &nbsp; -1 &nbsp; &nbsp;analitza/tests/analitzatest.cpp<br>
M &nbsp;+3 &nbsp; &nbsp;-3 &nbsp; &nbsp;analitza/value.cpp<br>
M &nbsp;+7 &nbsp; &nbsp;-7 &nbsp; &nbsp;analitza/value.h<br>
<br>
<a href="http://commits.kde.org/analitza/33bac90b347ce5424117e09b24a6d2a4de9dcdf9" \
target="_blank">http://commits.kde.org/analitza/33bac90b347ce5424117e09b24a6d2a4de9dcdf9</a><br>
 <br>
diff --git a/analitza/htmlexpressionwriter.cpp \
b/analitza/htmlexpressionwriter.cpp<br> index 87db178..ab5a21a 100644<br>
--- a/analitza/htmlexpressionwriter.cpp<br>
+++ b/analitza/htmlexpressionwriter.cpp<br>
@@ -32,6 +32,8 @@<br>
<br>
&nbsp;using namespace Analitza;<br>
<br>
+const double HtmlExpressionWriter::MIN_PRINTABLE_VALUE = 0.0000000000001; // since \
the precision we choose for 'G' is 12<br> +<br>
&nbsp;//we use the one in string*<br>
&nbsp;QMap&lt;Operator::OperatorType, QString&gt; initOperators();<br>
<br>
@@ -83,10 +85,37 @@ QVariant HtmlExpressionWriter::visit(const List* vec)<br>
<br>
&nbsp;QVariant HtmlExpressionWriter::visit(const Cn* var)<br>
&nbsp;{<br>
+ &nbsp; &nbsp; &nbsp; QString innerhtml;<br>
&nbsp; &nbsp; &nbsp; &nbsp; if(var-&gt;isBoolean())<br>
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return QString("&lt;span \
class='var'&gt;"+QString(var-&gt;isTrue() ? "true" : "false")+"&lt;/span&gt;");<br> + \
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; innerhtml = var-&gt;isTrue() ? \
"true" : "false";<br> + &nbsp; &nbsp; &nbsp; else if(var-&gt;isCharacter())<br>
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; innerhtml = \
QString(var-&gt;character());<br> + &nbsp; &nbsp; &nbsp; else if(var-&gt;isComplex()) \
{<br> + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; QString realpart;<br>
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; QString imagpart;<br>
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; bool realiszero = false;<br>
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if \
(qAbs(var-&gt;complexValue().real()) &gt; MIN_PRINTABLE_VALUE)<br> + &nbsp; &nbsp; \
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; realpart = \
QString::number(var-&gt;complexValue().real(), 'g', 12);<br> + &nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp; &nbsp; &nbsp; else<br> + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; realiszero = true;<br> +<br>
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (var-&gt;complexValue().imag() \
!= 1) {<br> + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; if (qAbs(var-&gt;complexValue().imag()) &gt; MIN_PRINTABLE_VALUE) {<br> + \
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp; &nbsp; if (!realiszero &amp;&amp; \
var-&gt;complexValue().imag()&gt;0.)<br> + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; realpart += QLatin1String("+");<br> + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; imagpart = \
QString::number(var-&gt;complexValue().imag(), 'g', 12);<br> + &nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
imagpart += QLatin1String("*i");<br> + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br> + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; } else &nbsp;{<br> + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp; &nbsp; imagpart = QLatin1String("i");<br> + &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp; &nbsp; }<br> +<br>
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; innerhtml = realpart+imagpart;<br>
+ &nbsp; &nbsp; &nbsp; }<br>
&nbsp; &nbsp; &nbsp; &nbsp; else<br>
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return QString("&lt;span \
class='num'&gt;"+QString::number(var-&gt;value(), 'g', 12)+"&lt;/span&gt;");<br> + \
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; innerhtml = \
QString::number(var-&gt;value(), 'g', 12);<br> +<br>
+ &nbsp; &nbsp; &nbsp; return QString("&lt;span \
class='num'&gt;"+innerhtml+"&lt;/span&gt;");<br> &nbsp;}<br>
<br>
&nbsp;QVariant HtmlExpressionWriter::visit(const Analitza::Ci* var)<br>
diff --git a/analitza/htmlexpressionwriter.h b/analitza/htmlexpressionwriter.h<br>
index 0b2660c..0456a21 100644<br>
--- a/analitza/htmlexpressionwriter.h<br>
+++ b/analitza/htmlexpressionwriter.h<br>
@@ -54,6 +54,7 @@ class HtmlExpressionWriter : public AbstractExpressionVisitor<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; template &lt;class T&gt;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
static QStringList allValues(T it, const T&amp; itEnd, AbstractExpressionVisitor* \
writer);<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; QVariant \
m_result;<br> + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; static const double \
MIN_PRINTABLE_VALUE;<br> &nbsp;};<br>
<br>
&nbsp;}<br>
diff --git a/analitza/operations.cpp b/analitza/operations.cpp<br>
index cdd0027..f14e463 100644<br>
--- a/analitza/operations.cpp<br>
+++ b/analitza/operations.cpp<br>
@@ -151,19 +151,19 @@ Cn* reduceRealReal(enum Operator::OperatorType op, Cn *oper, \
double a, double b,<br> &nbsp; &nbsp; &nbsp; &nbsp; return oper;<br>
&nbsp;}<br>
<br>
-static bool operator&lt;(complex&lt;float&gt; a, complex&lt;float&gt; b)<br>
+static bool operator&lt;(complex&lt;double&gt; a, complex&lt;double&gt; b)<br>
&nbsp;{ return a.real() &lt; b.real() || (a.real() == b.real() &amp;&amp; \
a.imag()&lt;b.imag()); }<br> <br>
-static bool operator&gt;(complex&lt;float&gt; a, complex&lt;float&gt; b)<br>
+static bool operator&gt;(complex&lt;double&gt; a, complex&lt;double&gt; b)<br>
&nbsp;{ return a.real() &gt; b.real() || (a.real() == b.real() &amp;&amp; \
a.imag()&gt;b.imag()); }<br> <br>
-static bool operator&lt;=(complex&lt;float&gt; a, complex&lt;float&gt; b)<br>
+static bool operator&lt;=(complex&lt;double&gt; a, complex&lt;double&gt; b)<br>
&nbsp;{ return a.real() &lt;= b.real() || (a.real() == b.real() &amp;&amp; \
a.imag()&lt;=b.imag()); }<br> <br>
-static bool operator&gt;=(complex&lt;float&gt; a, complex&lt;float&gt; b)<br>
+static bool operator&gt;=(complex&lt;double&gt; a, complex&lt;double&gt; b)<br>
&nbsp;{ return a.real() &gt;= b.real() || (a.real() == b.real() &amp;&amp; \
a.imag()&gt;=b.imag()); }<br> <br>
-Cn* reduceComplexComplex(enum Operator::OperatorType op, Cn *oper, \
complex&lt;float&gt; a, complex&lt;float&gt; b, QString** correct)<br> +Cn* \
reduceComplexComplex(enum Operator::OperatorType op, Cn *oper, complex&lt;double&gt; \
a, complex&lt;double&gt; b, QString** correct)<br> &nbsp;{<br>
&nbsp; &nbsp; &nbsp; &nbsp; switch(op) {<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; case Operator::plus:<br>
@@ -274,7 +274,7 @@ Cn* reduceComplexComplex(enum Operator::OperatorType op, Cn \
*oper, complex&lt;float<br> &nbsp;Cn* Operations::reduceValueValue(enum \
Operator::OperatorType op, Cn *oper, const Cn *oper1, QString** correct)<br> \
&nbsp;{<br> &nbsp; &nbsp; &nbsp; &nbsp; if(KDE_ISUNLIKELY(oper-&gt;isComplex() || \
                oper1-&gt;isComplex())) {<br>
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; const complex&lt;float&gt; \
a=oper-&gt;complexValue(), b=oper1-&gt;complexValue();<br> + &nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp; &nbsp; &nbsp; const complex&lt;double&gt; a=oper-&gt;complexValue(), \
b=oper1-&gt;complexValue();<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; return reduceComplexComplex(op, oper, a, b, correct);<br> &nbsp; &nbsp; &nbsp; \
&nbsp; } else {<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; const \
double a=oper-&gt;value(), b=oper1-&gt;value();<br> @@ -292,7 +292,7 @@ Cn* \
Operations::reduceUnaryValue(Operator::OperatorType op, Cn* oper, QString**<br> <br>
&nbsp;Cn* Operations::reduceUnaryComplex(Operator::OperatorType op, Cn* val, \
QString** correct)<br> &nbsp;{<br>
- &nbsp; &nbsp; &nbsp; const complex&lt;float&gt; a=val-&gt;complexValue();<br>
+ &nbsp; &nbsp; &nbsp; const complex&lt;double&gt; a=val-&gt;complexValue();<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; switch(op) {<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; case Operator::minus:<br>
diff --git a/analitza/stringexpressionwriter.cpp \
b/analitza/stringexpressionwriter.cpp<br> index 4f434aa..50012b3 100644<br>
--- a/analitza/stringexpressionwriter.cpp<br>
+++ b/analitza/stringexpressionwriter.cpp<br>
@@ -30,6 +30,8 @@<br>
<br>
&nbsp;using namespace Analitza;<br>
<br>
+const double StringExpressionWriter::MIN_PRINTABLE_VALUE = 0.0000000000001; // since \
the precision we choose for 'G' is 12<br> +<br>
&nbsp;template &lt;class T&gt;<br>
&nbsp;QStringList StringExpressionWriter::allValues(T it, const T&amp; itEnd, \
AbstractExpressionVisitor* writer)<br> &nbsp;{<br>
@@ -105,8 +107,28 @@ QVariant StringExpressionWriter::visit(const Cn* var)<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return var-&gt;isTrue() ? \
"true" : "false";<br> &nbsp; &nbsp; &nbsp; &nbsp; else if(var-&gt;isCharacter())<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return \
                QString(var-&gt;character());<br>
- &nbsp; &nbsp; &nbsp; else if(var-&gt;isComplex())<br>
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return \
QVariant::fromValue&lt;QString&gt;(QString::number(var-&gt;complexValue().real(), \
'g', 12) + QLatin1String("+i*") + QString::number(var-&gt;complexValue().imag(), 'g', \
12));<br>


+ &nbsp; &nbsp; &nbsp; else if(var-&gt;isComplex()) {<br>
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; QString realpart;<br>
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; QString imagpart;<br>
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; bool realiszero = false;<br>
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if \
(qAbs(var-&gt;complexValue().real()) &gt; MIN_PRINTABLE_VALUE)<br> + &nbsp; &nbsp; \
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; realpart = \
QString::number(var-&gt;complexValue().real(), 'g', 12);<br> + &nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp; &nbsp; &nbsp; else<br> + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; realiszero = true;<br> +<br>
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (var-&gt;complexValue().imag() \
!= 1) {<br> + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; if (qAbs(var-&gt;complexValue().imag()) &gt; MIN_PRINTABLE_VALUE) {<br> + \
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp; &nbsp; if (!realiszero &amp;&amp; \
var-&gt;complexValue().imag()&gt;0.)<br> + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; realpart += QLatin1String("+");<br> + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; imagpart = \
QString::number(var-&gt;complexValue().imag(), 'g', 12);<br> + &nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
imagpart += QLatin1String("*i");<br> + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br> + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; } else &nbsp;{<br> + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp; &nbsp; imagpart = QLatin1String("i");<br> + &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp; &nbsp; }<br> +<br>
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return \
QVariant::fromValue&lt;QString&gt;(realpart+imagpart);<br> + &nbsp; &nbsp; &nbsp; \
}<br> &nbsp; &nbsp; &nbsp; &nbsp; else<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return \
QString::number(var-&gt;value(), 'g', 12);<br> &nbsp;}<br>
diff --git a/analitza/stringexpressionwriter.h \
b/analitza/stringexpressionwriter.h<br> index 523de30..6f9fb98 100644<br>
--- a/analitza/stringexpressionwriter.h<br>
+++ b/analitza/stringexpressionwriter.h<br>
@@ -58,6 +58,7 @@ class StringExpressionWriter : public AbstractExpressionVisitor<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
static QStringList allValues(T it, const T&amp; itEnd, AbstractExpressionVisitor* \
writer);<br> <br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; QVariant m_result;<br>
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; static const double \
MIN_PRINTABLE_VALUE;<br> &nbsp;};<br>
<br>
&nbsp;}<br>
diff --git a/analitza/tests/analitzatest.cpp b/analitza/tests/analitzatest.cpp<br>
index 47d3c84..fcec6e8 100644<br>
--- a/analitza/tests/analitzatest.cpp<br>
+++ b/analitza/tests/analitzatest.cpp<br>
@@ -115,6 +115,7 @@ void AnalitzaTest::testTrivialCalculate_data()<br>
&nbsp; &nbsp; &nbsp; &nbsp; QTest::newRow("cpx1") &lt;&lt; "i" &lt;&lt; Cn(0, 1);<br>
&nbsp; &nbsp; &nbsp; &nbsp; QTest::newRow("cpx2") &lt;&lt; "i*i" &lt;&lt; Cn(-1);<br>
&nbsp; &nbsp; &nbsp; &nbsp; QTest::newRow("cpx3") &lt;&lt; "2+i*i" &lt;&lt; \
Cn(1);<br> + &nbsp; &nbsp; &nbsp; QTest::newRow("complex number") &lt;&lt; \
"3+4*(5-6*i)" &lt;&lt; Cn(23, -24);<br> &nbsp;}<br>
<br>
&nbsp;void AnalitzaTest::testTrivialCalculate()<br>
@@ -142,8 +143,14 @@ void AnalitzaTest::testTrivialEvaluate_data()<br>
&nbsp;{<br>
&nbsp; &nbsp; &nbsp; &nbsp; QTest::addColumn&lt;QString&gt;("expression");<br>
&nbsp; &nbsp; &nbsp; &nbsp; QTest::addColumn&lt;QString&gt;("result");<br>
-<br>
+<br>
&nbsp; &nbsp; &nbsp; &nbsp; QTest::newRow("simple value") &lt;&lt; "2" &lt;&lt; \
"2";<br> + &nbsp; &nbsp; &nbsp; QTest::newRow("simple complex value") &lt;&lt; \
"6*(2+i)" &lt;&lt; "12+6*i";<br> + &nbsp; &nbsp; &nbsp; QTest::newRow("complex \
irreductibility") &lt;&lt; "i" &lt;&lt; "i";<br> + &nbsp; &nbsp; &nbsp; \
QTest::newRow("from complex value") &lt;&lt; "i*i" &lt;&lt; "-1";<br> + &nbsp; &nbsp; \
&nbsp; QTest::newRow("from power complex") &lt;&lt; "power(i, 2)" &lt;&lt; "-1";<br> \
+ &nbsp; &nbsp; &nbsp; QTest::newRow("sin complex") &lt;&lt; "sin(i)" &lt;&lt; \
"1.17520119364*i";<br> + &nbsp; &nbsp; &nbsp; QTest::newRow("cos complex") &lt;&lt; \
"cos(5-9*i)" &lt;&lt; "1149.26926545-3885.12187972*i";<br> &nbsp; &nbsp; &nbsp; \
&nbsp; QTest::newRow("simple addition") &lt;&lt; "2+2" &lt;&lt; "4";<br> &nbsp; \
&nbsp; &nbsp; &nbsp; QTest::newRow("simple addition with var") &lt;&lt; "2+x" \
&lt;&lt; "x+2";<br> &nbsp; &nbsp; &nbsp; &nbsp; QTest::newRow("minus \
irreductibility") &lt;&lt; "-x" &lt;&lt; "-x";<br> @@ -314,6 +321,12 @@ void \
AnalitzaTest::testCorrection_data()<br> &nbsp; &nbsp; &nbsp; &nbsp; \
QTest::addColumn&lt;QString&gt;("result");<br> <br>
&nbsp; &nbsp; &nbsp; &nbsp; QStringList script;<br>
+<br>
+ &nbsp; &nbsp; &nbsp; script.clear();<br>
+ &nbsp; &nbsp; &nbsp; script &lt;&lt; "f:=y-&gt;y*y";<br>
+ &nbsp; &nbsp; &nbsp; script &lt;&lt; "f(i)";<br>
+ &nbsp; &nbsp; &nbsp; QTest::newRow("from complex function") &lt;&lt; script \
&lt;&lt; "-1";<br> +<br>
&nbsp; &nbsp; &nbsp; &nbsp; script.clear();<br>
&nbsp; &nbsp; &nbsp; &nbsp; script &lt;&lt; "n:=2";<br>
&nbsp; &nbsp; &nbsp; &nbsp; script &lt;&lt; "n+1";<br>
diff --git a/analitza/value.cpp b/analitza/value.cpp<br>
index 8f567f1..fe0b8f3 100644<br>
--- a/analitza/value.cpp<br>
+++ b/analitza/value.cpp<br>
@@ -116,12 +116,12 @@ void Cn::setValue(bool v)<br>
&nbsp; &nbsp; &nbsp; &nbsp; m_imaginaryPart = 0;<br>
&nbsp;}<br>
<br>
-std::complex&lt;float&gt; Cn::complexValue() const<br>
+std::complex&lt;double&gt; Cn::complexValue() const<br>
&nbsp;{<br>
- &nbsp; &nbsp; &nbsp; return std::complex&lt;float&gt;(m_value, \
m_imaginaryPart);<br> + &nbsp; &nbsp; &nbsp; return \
std::complex&lt;double&gt;(m_value, m_imaginaryPart);<br> &nbsp;}<br>
<br>
-void Cn::setValue(std::complex&lt;float&gt; v)<br>
+void Cn::setValue(std::complex&lt;double&gt; v)<br>
&nbsp;{<br>
&nbsp; &nbsp; &nbsp; &nbsp; if(v.imag() == 0)<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; setValue(v.real());<br>
diff --git a/analitza/value.h b/analitza/value.h<br>
index ab60dc0..176c825 100644<br>
--- a/analitza/value.h<br>
+++ b/analitza/value.h<br>
@@ -63,8 +63,8 @@ class ANALITZA_EXPORT Cn : public Object<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; explicit Cn(const QChar&amp; \
c) : Object(Object::value), m_char(c.unicode()), m_imaginaryPart(0), m_format(Char) \
{}<br> <br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /** Constructor. Creates a \
                value that represents a complex. */<br>
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; explicit Cn(float value, float \
imaginaryPart) : Object(Object::value), m_value(value), \
m_imaginaryPart(imaginaryPart), m_format(Complex) {qDebug() &lt;&lt; "xxxxxxxxxx" \
&lt;&lt; toString();}<br>


-<br>
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; explicit Cn(double value, double \
imaginaryPart) : Object(Object::value), m_value(value), \
m_imaginaryPart(imaginaryPart), m_format(Complex) {}<br> +<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /**<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;* &nbsp; &nbsp; \
&nbsp;Extracts the number from the @p e Dom element and saves it.<br> &nbsp; &nbsp; \
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;*/<br> @@ -78,7 +78,7 @@ class \
ANALITZA_EXPORT Cn : public Object<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp; void setValue(int v);<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp; void setValue(uint v);<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
                &nbsp; &nbsp; void setValue(bool v);<br>
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; void \
setValue(std::complex&lt;float&gt; v);<br> + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp; void setValue(std::complex&lt;double&gt; v);<br> <br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /**<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;* &nbsp; &nbsp; \
&nbsp;Returns the value.<br> @@ -149,16 +149,16 @@ class ANALITZA_EXPORT Cn : public \
Object<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; QChar character() \
const { Q_ASSERT(m_format==Char); return QChar(m_char); }<br> <br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /** @returns whether the \
                value has an imaginary part */<br>
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; bool isComplex() const { return \
m_format == Complex; }<br> + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; bool \
isComplex() const { return m_format == Complex &amp;&amp; m_imaginaryPart!=0.; }<br> \
<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; virtual QVariant \
                accept(AbstractExpressionVisitor*) const;<br>
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; virtual bool isZero() const { \
return m_value==0. &amp;&amp; m_imaginaryPart==0.f; }<br> + &nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp; &nbsp; &nbsp; virtual bool isZero() const { return m_value==0. \
&amp;&amp; m_imaginaryPart==0.; }<br> <br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; virtual bool matches(const \
Object* exp, QMap&lt; QString, const Object* &gt;* found) const;<br> &nbsp; &nbsp; \
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /*/** Sets whether it is a correct Cn.<br> \
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; void setCorrect(bool b) \
{m_correct = b; }*/<br> <br>
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; std::complex&lt;float&gt; \
complexValue() const;<br> + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
std::complex&lt;double&gt; complexValue() const;<br> <br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; virtual Object* copy() \
const;<br> <br>
@@ -167,7 +167,7 @@ class ANALITZA_EXPORT Cn : public Object<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; static Cn euler();<br>
&nbsp; &nbsp; &nbsp; &nbsp; private:<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; union { double m_value; \
                ushort m_char; };<br>
- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; float m_imaginaryPart;<br>
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; double m_imaginaryPart;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; enum ValueFormat \
m_format;<br> &nbsp;};<br>
<br>
<br>
</blockquote></div><br></div>
</div></blockquote></div><div><span></span></div></div><div><span></span></div></body></html>




[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic