more double changes

This commit is contained in:
Michiharu Ariza 2018-12-03 15:32:42 -08:00
parent 9af33d7a2a
commit 9e5180cd44
2 changed files with 9 additions and 9 deletions

View File

@ -229,10 +229,10 @@ struct Number
{
return (int32_t)(value * 65536.0);
}
inline void set_real (float v) { value = (double)v; }
inline float to_real (void) const
inline void set_real (double v) { value = (double)v; }
inline double to_real (void) const
{
return (float)value;
return value;
}
inline int ceil (void) const
@ -520,7 +520,7 @@ struct ArgStack : Stack<ARG, 513>
n.set_fixed (v);
}
inline void push_real (float v)
inline void push_real (double v)
{
ARG &n = S::push ();
n.set_real (v);

View File

@ -103,9 +103,9 @@ struct DictOpSet : OpSet<Number>
}
}
static inline float parse_bcd (SubByteStr& substr)
static inline double parse_bcd (SubByteStr& substr)
{
float v = 0.0f;
double v = 0.0;
bool neg = false;
double int_part = 0;
@ -126,7 +126,7 @@ struct DictOpSet : OpSet<Number>
if (!substr.avail ())
{
substr.set_error ();
return 0.0f;
return 0.0;
}
byte = substr[0];
substr.inc ();
@ -152,13 +152,13 @@ struct DictOpSet : OpSet<Number>
else
value *= pow (10.0, (double)exp_part);
}
return (float)value;
return value;
case NEG:
if (i != 0)
{
substr.set_error ();
return 0.0f;
return 0.0;
}
neg = true;
break;