next = NULL;
}
-wxExpr::wxExpr(float the_real)
+wxExpr::wxExpr(double the_real)
{
type = wxExprReal;
value.real = the_real;
Append(listExpr);
}
-void wxExpr::AddAttributeValue(const wxString& attribute, float val)
+void wxExpr::AddAttributeValue(const wxString& attribute, double val)
{
if (type != wxExprList)
{
}
bool wxExpr::GetAttributeValue(const wxString& att, float& var) const
+{
+ wxExpr *expr = AttributeValue(att);
+ if (expr && (expr->Type() == wxExprInteger || expr->Type() == wxExprReal))
+ {
+ var = (float) expr->RealValue();
+ return TRUE;
+ }
+ else
+ return FALSE;
+}
+
+bool wxExpr::GetAttributeValue(const wxString& att, double& var) const
{
wxExpr *expr = AttributeValue(att);
if (expr && (expr->Type() == wxExprInteger || expr->Type() == wxExprReal))
}
case wxExprReal:
{
- float f = value.real;
+ double f = value.real;
/* Now the parser can cope with this.
// Prevent printing in 'e' notation. Any better way?
if (fabs(f) < 0.00001)
return found;
}
-wxExpr *wxExprDatabase::FindClause(const wxString& word, float val)
+wxExpr *wxExprDatabase::FindClause(const wxString& word, double val)
{
wxExpr *found = NULL;
while (position && !found)
char buf[50];
sprintf(buf, "%s.%s", str1, str2);
- float f = (float)atof(buf);
+ double f = (double)atof(buf);
wxExpr *x = new wxExpr(f);
return (char *)x;
double d = mantissa * pow(10.0, exponent);
- wxExpr *x = new wxExpr((float)d);
+ wxExpr *x = new wxExpr(d);
return (char *)x;
}
double d = mantissa * pow(10.0, exponent);
- wxExpr *x = new wxExpr((float)d);
+ wxExpr *x = new wxExpr(d);
return (char *)x;
}