Commit b81e44f8 authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

jscript: Make parsing of double more accurate.

parent 6aafd2f1
......@@ -621,7 +621,9 @@ static HRESULT JSGlobal_parseFloat(script_ctx_t *ctx, vdisp_t *jsthis, WORD flag
}
V_VT(retv) = VT_R8;
V_R8(retv) = (double)(positive?d:-d)*pow(10, exp);
if(!positive)
d = -d;
V_R8(retv) = (exp>0 ? d*pow(10, exp) : d/pow(10, -exp));
return S_OK;
}
......
......@@ -474,7 +474,7 @@ static int parse_double_literal(parser_ctx_t *ctx, LONG int_part, literal_t **li
else exp += e;
}
*literal = new_double_literal(ctx, (DOUBLE)d*pow(10, exp));
*literal = new_double_literal(ctx, exp>=0 ? d*pow(10, exp) : d/pow(10, -exp));
return tNumericLiteral;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment