jscript: Added implementation of Math_pow with less then 2 arguments.
This commit is contained in:
parent
3327d17109
commit
f77489acd5
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue