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

jscript: Added implementation of Math_pow with less then 2 arguments.

parent 3327d171
......@@ -441,8 +441,8 @@ static HRESULT Math_pow(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *d
TRACE("\n");
if(arg_cnt(dp) < 2) {
FIXME("unimplemented arg_cnt %d\n", arg_cnt(dp));
return E_NOTIMPL;
if(retv) num_set_nan(retv);
return S_OK;
}
hres = to_number(dispex->ctx, get_arg(dp, 0), ei, &x);
......
......@@ -618,6 +618,12 @@ ok(tmp === 2, "Math.pow(2, 2) = " + tmp);
tmp = Math.pow(2, 2, 3);
ok(tmp === 4, "Math.pow(2, 2, 3) = " + tmp);
tmp = Math.pow(2);
ok(isNaN(tmp), "Math.pow(2) is not NaN");
tmp = Math.pow();
ok(isNaN(tmp), "Math.pow() is not NaN");
tmp = Math.random();
ok(typeof(tmp) == "number", "typeof(tmp) = " + typeof(tmp));
ok(0 <= tmp && tmp <= 1, "Math.random() = " + tmp);
......
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