jscript: Added Math_cos implementation.

This commit is contained in:
Piotr Caban 2009-04-02 19:55:30 +02:00 committed by Alexandre Julliard
parent 885a9e9c0c
commit fe5785af09
1 changed files with 16 additions and 2 deletions

View File

@ -212,8 +212,22 @@ static HRESULT Math_ceil(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *
static HRESULT Math_cos(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp,
VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp)
{
FIXME("\n");
return E_NOTIMPL;
VARIANT v;
HRESULT hres;
TRACE("\n");
if(!arg_cnt(dp)) {
if(retv) num_set_nan(retv);
return S_OK;
}
hres = to_number(dispex->ctx, get_arg(dp, 0), ei, &v);
if(FAILED(hres))
return hres;
if(retv) num_set_val(retv, cos(num_val(&v)));
return S_OK;
}
static HRESULT Math_exp(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp,